5.0.0-alpha2
Pre-release
Pre-release
Many updates!
- NEW
livedata
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
wrapperenable
anddisable
have been replaced with their SQL accurate counterpartscreateIfNotExists
anddrop
. - 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
andFTS3
support. - Breaking: Require
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>()
- 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. - Breaking:
IMultiKeyCacheConverter
->MultiKeyCacheConverter
- NEW: create
TEMP
tables support using@Table(temporary = true)
- Breaking: async queries from RX
asFlowable
or others, instead of passingDatabaseWrapper
andModelQueriable
like:
.asFlowable { d, modelQueriable -> modelQueriable.queryList(d) }
Now its the receiver parameter of the function:
.asFlowable { db -> queryList(db) }
- 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.
Also many bug fixes!
https://github.com/agrosner/DBFlow/milestone/51?closed=1