3.0.0-beta4
Pre-release
Pre-release
This release contains a few major updates.
- All unit tests are now run in JVM via Robolectric
@ForeignKey
nowsaveForeignKeyModel=false
by default, since this can lead to errors or unexplained performance hits. Rather be safe to be explicit!@ManyToMany
can now specify the name of the generated join table. Also they can point to themselves (i.e.User_User
). Also can configuresaveForeignKeyModels()
for each generated@ForeignKey
.@ContentProvider
generated now call down directly to the corresponding database methods. This is to simplify and prevent most other issues from coming up.- Now there's an incubating
dbflow-kotlinextensions
! It provides some Kotlin language features such asitems.processInTransactionAsync { it.save() }
or5.property.eq(SomeTable_Table.num)
Migration
no longer require empty constructor, but also support, since this led to hard-to-find compile time errors for some people:
public TestMigration(Class<TestModel1> table) {
super(table);
}
- Versions of 3.0.0-beta1 - 3.0.0-beta3 incorrectly created tables that specified
autoincrement=true
. What happened is that it treated them like a ROWID. This is fixed in this version, and to fix it for any existing table, you must include and subclass the included migration snippet here. It will run a one-time migration check if you had used this in earlier versions of the 3.0 lib. If it doesn't affect you or seem to notice, a newrowID
param has been added to the@PrimaryKey
annotation that will keep the existing way (to prevent inconsistencies). - all wrapper queries now have access to
hasData()
which returnscount() > 0
. - All saving, updating, deleting, and inserting is now done via a configurable
ModelSaver
class. All correspondingSqlUtils
static methods have been deprecated. To specify your own subclass for any extra behavior:
FlowManager.getModelAdapter(SomeTable.class).setModelSaver(new MySubclassModelSaver());
// this might need to get configured for the corresponding `ModelContainerAdapter` if you use `@ModelContainer`.
FlowManager.getContainerAdapter(SomeTable.class).setModelSaver(new MyModelContainerSubclassModelSaver());
- Fix issues with
TypeConverter
that usedBlob
as its database class. Properly convert the blob to a hex string using a super-efficient algorithm. - Fixed null values as strings that would insert
'null'
instead of the databaseNULL
, which could lead to head-scratching why a query likeSQLite.delete(SomeTable.class).where(SomeTable_Table.column.eq(null)).execute()
would fail to delete in some scenarios. _Table
classes now give you access to an array ofIProperty
from the table viagetAllColumnProperties()
. Useful in queries or table information.- Can attached queries as properties now:
SQLite.select(SQLite.select().from(SomeTable.class).where(..)).from(SomethingElse.class)....
(SELECT (SELECT * From...)) - Doc improvements, bug fixes and more.