Skip to content

3.1.0

Compare
Choose a tag to compare
@agrosner agrosner released this 02 Jul 18:04
· 1094 commits to master since this release
  1. Bug fixes
  2. Fixes an issue where prepackaged databases were not copied over on initialization of DB. #867. Affects all versions post-3.0.0-beta6.
  3. New builder syntax for FlowQueryList + FlowCursorList. Deprecated a lot of their old methods. Also created a FlowCursorIterator so that iteration in FlowCursorList + FlowQueryList becomes way more efficient. Instead of loading the full list when iterating, it iterates and converts objects as you need them:
for (TestModel model : cursorList) {

}
  1. Can add primaryKeyConflict to @Table to optionally specify a conflict for a Primary key that gets appended to the creation query.
  2. NEW Kotlin SQLite LINQ-Style Syntax and improvements to the Kotlin Support. In dbflow-kotlinextensions you can now write queries in Kotlin as:
var results = (select
                      from Result::class
                      where (column eq 6)
                      and (column2 `in`("5", "6", "9"))
                      groupBy column).list
              // can call .result for single result
              // .hasData if it has results
              // .statement for a compiled statement

Some new syntactic sugar that makes queries even more functional:

model.async save {
  // completed, now do something with model
}

Retrievals:

(select
    from Result::class
    where (column eq 6))
 .async result { transaction, model ->
    // do something here
    updateUI(model)
}

for Lists:

// easy async list query
(select
    from Result::class
    where (column eq 6))
.async list { transaction, list ->
    // do something here
    updateUI(list)
}