5.0.0-alpha2
Pre-release
Pre-release
Many updates!
- NEW
livedataartifact (consider it experimental). Call.toLiveDataon 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:
Indexwrapperenableanddisablehave been replaced with their SQL accurate counterpartscreateIfNotExistsanddrop. - 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
randomorderby method - Migrations: support default values in
ALTERtable 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
onConfigureof the DB. - NEW:
FTS4andFTS3support. - Breaking: Require
DatabaseWrapperin 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:
TableObserverprovides a way to observe table changes in an efficient way for observable queries. - NEW:
matchoperator for queries - NEW: tables can be represented without actually being created in the DB. use
createWithDatabasein the@Tableor@ModelViewannotations. - Breaking:
IMultiKeyCacheConverter->MultiKeyCacheConverter - NEW: create
TEMPtables support using@Table(temporary = true) - Breaking: async queries from RX
asFlowableor others, instead of passingDatabaseWrapperandModelQueriablelike:
.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
Handlerto 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