NEWlivedata artifact (consider it experimental). Call .toLiveData on your wrapper queries when included in the project.
Docs have been revamped, lots of fixes and improvements. Removed all java examples in favor of Kotlin usage
Gradle files now use kotlin
Respect order of Primary Key definition in insert statement
Optimize more code generation
RX support is bumped to RX3
Breaking: Index wrapper enable and disable have been replaced with their SQL accurate counterparts createIfNotExists and drop.
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>()
}
SQL: adds random orderby method
Migrations: support default values in ALTER table statement
Migrations: Restore pre 5.0.0-alpha1 migration order where they run after table creation in upgrade of DB.
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.
NEW: FTS4 and FTS3 support.
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>()
Breaking: Breaking change: String "?" no longer are unescaped and treated as blank INSERT value args. Use Property.WILDCARD instead.
Model queries that do not run in a transaction now will log as warnings to encourage you to place them in transactions.
NEW: TableObserver provides a way to observe table changes in an efficient way for observable queries.
NEW: match operator for queries
NEW: tables can be represented without actually being created in the DB. use createWithDatabase in the @Table or @ModelView annotations.
OneToMany: fix issue where cache and one to many would not work when using the all operators.
FlowQueryList/FlowCursorList: allow passing own Handler to be used rather than the thread its created on.
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
BaseProviderModel: fix potential leaking cursor when no results found.
SQLCipher: Latest version is now 4.4.2, Write ahead logging support!
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.
Many updates!
livedata
artifact (consider it experimental). Call.toLiveData
on your wrapper queries when included in the project.Index
wrapperenable
anddisable
have been replaced with their SQL accurate counterpartscreateIfNotExists
anddrop
.random
orderby methodALTER
table statementonConfigure
of the DB.FTS4
andFTS3
support.DatabaseWrapper
in any db operation, removing model extension methods that are parameterless in most places. to grab DB, usedatabase<MyDatabase> { db ->
orval db = database<MyDatabase>()
TableObserver
provides a way to observe table changes in an efficient way for observable queries.match
operator for queriescreateWithDatabase
in the@Table
or@ModelView
annotations.IMultiKeyCacheConverter
->MultiKeyCacheConverter
TEMP
tables support using@Table(temporary = true)
asFlowable
or others, instead of passingDatabaseWrapper
andModelQueriable
like:Now its the receiver parameter of the function:
Handler
to be used rather than the thread its created on.Also many bug fixes! https://github.com/agrosner/DBFlow/milestone/51?closed=1