Skip to content

5.0.0-alpha2

Pre-release
Pre-release
Compare
Choose a tag to compare
@agrosner agrosner released this 13 Mar 15:20
· 1 commit to master since this release

Many updates!

  1. NEW livedata artifact (consider it experimental). Call .toLiveData on your wrapper queries when included in the project.
  2. Docs have been revamped, lots of fixes and improvements. Removed all java examples in favor of Kotlin usage
  3. Gradle files now use kotlin
  4. Respect order of Primary Key definition in insert statement
  5. Optimize more code generation
  6. RX support is bumped to RX3
  7. Breaking: Index wrapper enable and disable have been replaced with their SQL accurate counterparts createIfNotExists and drop.
  8. New: DBFLow configure DSL
FlowManager.init(context) { 
  // this is FlowConfig.Builder
  database<AppDatabase> {
    // this is DatabaseConfig.Builder
    table<MyTable> {
      // this is TableConfig.Builder
    }
  }
  // other module dbs
  databaseHolder<MyGeneratedDatabaseHolder>()
}
  1. SQL: adds random orderby method
  2. Migrations: support default values in ALTER table statement
  3. Migrations: Restore pre 5.0.0-alpha1 migration order where they run after table creation in upgrade of DB.
  4. Foreign Key Constraints: fix issue where foreign key constraint support not always enabled or done properly. Now we perform it in onConfigure of the DB.
  5. NEW: FTS4 and FTS3 support.
  6. Breaking: Require DatabaseWrapper in any db operation, removing model extension methods that are parameterless in most places. to grab DB, use database<MyDatabase> { db -> or val db = database<MyDatabase>()
  7. Breaking: Breaking change: String "?" no longer are unescaped and treated as blank INSERT value args. Use Property.WILDCARD instead.
  8. Model queries that do not run in a transaction now will log as warnings to encourage you to place them in transactions.
  9. NEW: TableObserver provides a way to observe table changes in an efficient way for observable queries.
  10. NEW: match operator for queries
  11. NEW: tables can be represented without actually being created in the DB. use createWithDatabase in the @Table or @ModelView annotations.
  12. Breaking: IMultiKeyCacheConverter -> MultiKeyCacheConverter
  13. NEW: create TEMP tables support using @Table(temporary = true)
  14. Breaking: async queries from RX asFlowable or others, instead of passing DatabaseWrapper and ModelQueriable like:
.asFlowable { d, modelQueriable -> modelQueriable.queryList(d) }

Now its the receiver parameter of the function:

.asFlowable { db -> queryList(db) }
  1. OneToMany: fix issue where cache and one to many would not work when using the all operators.
  2. FlowQueryList/FlowCursorList: allow passing own Handler to be used rather than the thread its created on.
  3. Breaking: its an error to have multiple converters on the same model type. Error message describes how to fix.
  • allow overwriting built-ins without error
  • better error messaging in general with less noise
  1. BaseProviderModel: fix potential leaking cursor when no results found.
  2. SQLCipher: Latest version is now 4.4.2, Write ahead logging support!
  3. Breaking: prepackaged dbs now can run migrations to get to current version when db version is 0 but we set our db version to something higher. This reduces errors by allowing you to keep an older version of DB as prepackaged but will run through migrations to get to current app version's DB.

Also many bug fixes!
https://github.com/agrosner/DBFlow/milestone/51?closed=1