Code Monkey home page Code Monkey logo

dbflow's Introduction

Image

JitPack.io Android Weekly Android Arsenal

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.

Why Use DBFlow

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.

  • Extensibility: No restrictions on inheritance of your table classes. They can be plain POJOs, no subclass required, but as a convenience we recommend using 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.
  • Speed: Built with java's annotation processing code generation, there's almost zero runtime performance hit by using this library (only reflection is creation of the main, generated database module's constructor). This library saves hours of boilerplate code and maintenance by generating the code for you. With powerful model caching (multiple primary key 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.
  • SQLite Query Flow: The queries in this library adhere as closely as possible to SQLite native queries. select(name, screenSize).from(Android.class).where(name.is("Nexus 5x")).and(version.is(6.0)).querySingle()
  • Open Source: This library is fully open source and contributions are not only welcomed, but encouraged.
  • Robust: We support Trigger, ModelView, Index, Migration, built-in ways to manage database access, and many more features.
  • Multiple Databases, Multiple Modules: we seamlessly support multiple database files, database modules using DBFlow in other dependencies, simultaneously.
  • Built On SQLite: SQLite is the most widely used database engine in world and using it as your base, you are not tied to a limited set of platforms or libraries.

Changelog

Starting with 3.0.0-beta1+, Changes exist in the releases tab.

For pre-3.0 changes, check out here

Usage Docs

For more detailed usage, check out it out here

Including in your project

If you use KAPT (Kotlin's APT), then skip this first step.

We need to include the apt plugin in our classpath to enable Annotation Processing:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
}

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:

  apply plugin: 'com.neenbedankt.android-apt'

  def dbflow_version = "4.0.0-beta1"
  // 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 {
    apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
    // use kapt for kotlin apt
    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
  }

Pull Requests

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!

Maintained By

agrosner (@agrosner)

dbflow's People

Contributors

agrosner avatar hilljh82 avatar trevjonez avatar grennis avatar mozarcik avatar dylanrjames avatar wiyarmir avatar kaeawc avatar kamilzych avatar jdrider avatar simplysoft avatar brnhffmnn avatar ktzouno avatar rexee avatar mlebarron avatar mathieudebrito avatar lnikkila avatar kenkyee avatar arriolac avatar pplant avatar ymhuang0808 avatar sowrabh avatar paulpv avatar moranm avatar digitalbuddha avatar mickele avatar intrications avatar martino2k6 avatar maciejciemiega avatar ekt0s avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.