Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.jermainedilao:DBFlow:4.0.0-beta5'
}
dependencies {
implementation("com.github.jermainedilao:DBFlow:4.0.0-beta5")
}
<dependency>
<groupId>com.github.jermainedilao</groupId>
<artifactId>DBFlow</artifactId>
<version>4.0.0-beta5</version>
</dependency>
libraryDependencies += "com.github.jermainedilao" % "DBFlow" % "4.0.0-beta5"
:dependencies [[com.github.jermainedilao/DBFlow "4.0.0-beta5"]]
A robust, powerful, and very simple ORM android database library with annotation processing.
The library is built on speed, performance, and approachability. It not only eliminates most boiler-plate code for dealing with databases, but also provides a powerful and simple API to manage interactions.
Let DBFlow make SQL code flow like a steady stream so you can focus on writing amazing apps.
DBFlow is built from a collection of the best features of many database libraries in the most efficient way possible. Also, it is built to not only make it significantly easier to deal with databases on Android, but also to provide extensibility. Don't let an ORM or library get in your way, let the code you write in your applications be the best as possible.
BaseModel
. You can extend non-Model
classes in different packages and use them as your DB tables. Also you can subclass other tables to join the @Column
together, and again they can be in different packages.Model
too), you can surpass the speed of SQLite by reusing where possible. We have support for lazy-loading relationships on-demand such as @ForeignKey
or @OneToMany
that make queries happen super-fast.select(name, screenSize).from(Android.class).where(name.is("Nexus 5x")).and(version.is(6.0)).querySingle()
Trigger
, ModelView
, Index
, Migration
, built-in ways to manage database access, and many more features.Changes exist in the releases tab.
For more detailed usage, check out it out here
allProjects {
repositories {
// required to find the project's artifacts
maven { url "https://www.jitpack.io" }
}
}
Add the library to the project-level build.gradle, using the apt plugin to enable Annotation Processing:
def dbflow_version = "4.0.0-beta5"
// or dbflow_version = "develop-SNAPSHOT" for grabbing latest dependency in your project on the develop branch
// or 10-digit short-hash of a specific commit. (Useful for bugs fixed in develop, but not in a release yet)
dependencies {
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
// use kapt for kotlin apt if you're a Kotlin user
kapt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
// sql-cipher database encryption (optional)
compile "com.github.Raizlabs.DBFlow:dbflow-sqlcipher:${dbflow_version}"
compile "net.zetetic:android-database-sqlcipher:${sqlcipher_version}@aar"
// kotlin extensions
compile "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:${dbflow_version}"
}
// if you're building with Kotlin
kapt {
generateStubs = true
}
I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
2. If its a feature, bugfix, or anything please only change code to what you specify.
3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
4. Pull requests must be made against develop
branch. Any other branch (unless specified by the maintainers) will get rejected.
5. Have fun!