Skip to content

Releases: agrosner/DBFlow

4.0.0-beta3

12 Dec 00:03
Compare
Choose a tag to compare
4.0.0-beta3 Pre-release
Pre-release
  1. Rewrote most tests in full Kotlin
  2. Some bug fixes
  3. Update to 1.5.0-2 of Kotlin
  4. Update to compile with API 25 + 2.2.3 of Gradle plugin
  5. Simplified ForeignKeyReference annotation when specifying it in the @ForeignKey. Removed : columnType(), referencedFieldIsPrivate(),
    referencedFieldIsPackagePrivate(), referencedGetterName(), and referencedSetterName() since we already were grabbing the referenced definition in the processor. This will eliminate need for those fields and should make simple headaches go away!
  6. If DB gets closed, we reopen it next time we use it in the lib.
  7. Add Selection args to StringQuery
  8. Fixed an issue where multiple modules may have been broken.

4.0.0-beta2

13 Nov 19:45
Compare
Choose a tag to compare
4.0.0-beta2 Pre-release
Pre-release
  1. Upgrade to API 25 (7.1.1)
  2. @Column with TypeConverter now properly convert specified Model types in SQLite queries via the generated TypeConvertedProperty class! Also you can reverse the query to specify the Database-typed query in a SQLite query:
Coordinate coord = ...;
SQLite.select().from(MyTable.class).
  .where(MyTable_Table.coordinate.eq(coord))
  .querySingle();

or

Latitude lat = ...;
SQLite.select().from(MyTable.class).
  .where(MyTable_Table.coordinate.invertProperty().eq("40.707720, -74.014842"))
  .querySingle();
  1. Add BigDecimalConverter as default converted included in lib.
  2. Fix issue with private field access in a @ForeignKey reference, due to new processor code.
  3. More bug fixes.
  4. Remove type param from BaseModelView, no longer necessary or needed.
  5. Fixes issue where Enum were not properly converted.

4.0.0-beta1

17 Oct 03:45
Compare
Choose a tag to compare
4.0.0-beta1 Pre-release
Pre-release

In 4.0, DBFlow has greatly improved its internals and flexibility in this release. We have removed the Model restriction, rewritten the annotation processor completely in Kotlin, and more awesome improvements.

Major Changes In this release

  1. PrimaryKey can have TypeConverters, be table-based objects, and all kinds of objects. No real restrictions.
  2. ForeignKey have been revamped to allow stubbedRelationship. This replaces ForeignKeyContainer.
  3. Model interface now includes load() to enabled reloading very easily when fields change.
  4. All ModelContainer implementation + support has been removed. A few reasons pushed the removal, including implementation. Since removing support, the annotation processor is cleaner, easier to maintain, and more streamlined. Also the support for it was not up to par, and by removing it, we can focus on improving the quality of the other features.
  5. The annotation processor has been rewritten in Kotlin! By doing so, we reduced the code by ~13%.
  6. Removed the Model restriction on tables. If you leave out extending BaseModel, you must interact with the ModelAdapter.
  7. We generate ~45% less code than 3.0. Combined the _Table + _Adapter into the singular _Table class, which contains both Property + all of the regular ModelAdapter methods. To ease the transition to 4.0, it is named _Table but extends ModelAdapter. So most use cases / interactions will not break.

3.1.1

04 Jul 20:10
Compare
Choose a tag to compare

Fix issue where project did not build on jitpack.io due to javadoc issues.

Transaction Handler only initialized when used, not when class first accessed to prevent unnecessary Handler thread from starting.
Also Transaction now have a newBuilder() method to allow easy copying of existing Transaction.

3.1.0

02 Jul 18:04
Compare
Choose a tag to compare
  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)
}

3.0.1

29 May 19:06
Compare
Choose a tag to compare
  1. Fixes issue where AsyncModel operations did not actually operate on its associated Model.
  2. Fix code gen for overridden Update, Insert, delete ops where passing in DatabaseWrapper did not honor @OneToMany annotation.
  3. Fix issue where ListModelSaver ignores caching rules.

3.0.0

28 May 21:18
Compare
Choose a tag to compare

This release incorporates a host and slew of improvements. A large chunk of the library has been rewritten, reworked, and improved significantly.
New Features

  1. Properties: Instead of generated column String names, Property simplify queries even further and provide type-safety.
  2. Transactions Rewritten: Transactions have been rewritten from the ground-up to provide flexibility, better syntax, and easy customization. You can even swap out the library's system and replace it with your own.
  3. Database Encryption Support: via SQLCipher enables secure databases with minimal configuration and effort in DBFlow!
  4. Usage Docs: I rewrote usage docs to be more comprehensive and informative.
  5. Foreign Keys Simplified: no longer do you have to manually specify @ForeignKey references.
  6. Caching with Multiple Primary Keys: Caching now supports multiple primary keys and keys of any supported type.
  7. Database Modules: DBFlow is supported in multiple application projects via modules. This enables sharing of Databases and their associated files.
  8. Better Code Generation: Support package private fields from different packages, better error messaging during compile phase, significant code gen improvements, and more.
  9. Kotlin Extensions Support: Via dbflow-kotlinextensions allows you to write better DBFlow code in Kotlin.
  10. New SQLite features supported such as Case, CAST, and more!
  11. Many bug fixes, code comment improvements, code generation improvements, and more.

To read on the basic migration steps, read here

3.0.0-beta6

25 Apr 01:42
Compare
Choose a tag to compare
3.0.0-beta6 Pre-release
Pre-release

Ideally this will be the final beta before 3.0 goes live. The next release should incorporate any more bugs or issues found in 3.0, so keep reporting!

This release contains three significant updates:

  1. Initialization of DBFlow has changed. Now configuration of ModelAdapter, @Database, and other classes can mostly be done through the new FlowConfig.Builder class. For a simple example, view an example here
  2. The transactions system got a complete and utter overhaul. Welcome the Transaction.Builder! Each Transaction contains Success and Error callbacks for easy listening. See the migration guide for guidance. By default, we no longer use a priority-based queue for transactions. To keep that, read here. You can now also specify and roll your own ITransactionQueue or BaseTransactionManager, read up here.
  3. I rewrote the documentation completely for accuracy and for better organization. I hope you like!

Some new features:

  1. Can now use the CASE Operator! `SQLite.
SQLite.select(CaseModel_Table.customerId,
                CaseModel_Table.firstName,
                CaseModel_Table.lastName,
                SQLite.caseWhen(CaseModel_Table.country.eq("USA"))
                        .then("Domestic")
                        ._else("Foreign").end("CustomerGroup")).from(CaseModel.class);
  1. Can Collate.LOCALIZED and Collate.UNICODE
  2. Can now multipliedBy(), add(), dividedBy(), mod(), and concatenate() IProperty together.
  3. This release contains a number of bug fixes as well here](https://github.com/Raizlabs/DBFlow/issues?q=milestone%3A3.0.0-beta6+is%3Aclosed)

3.0.0-beta5

07 Mar 21:29
Compare
Choose a tag to compare
3.0.0-beta5 Pre-release
Pre-release
  1. Fixes a critical issue where some queries (those that end off at Where) count()/hasData() when run with empty table throws a SQLiteDoneException on the query. now suppresses exception and logs it.
  2. can now pass in DatabaseWrapper into any saving methods of a ModelAdapter in order to better work in migrations! So that we do not recursively call the SQLiteDatabaseObject. So now all CRUD operations are supported in DBFlow migrations:
ModelAdapter modelAdapter = FlowManager.getModelAdapter(SomeTable.class);

modelAdapter.save(wrapper, someModel);


modelAdapter.insert(wrapper, someModel); 

3.0.0-beta4

03 Mar 16:02
Compare
Choose a tag to compare
3.0.0-beta4 Pre-release
Pre-release

This release contains a few major updates.

  1. All unit tests are now run in JVM via Robolectric
  2. @ForeignKey now saveForeignKeyModel=false by default, since this can lead to errors or unexplained performance hits. Rather be safe to be explicit!
  3. @ManyToMany can now specify the name of the generated join table. Also they can point to themselves (i.e. User_User). Also can configure saveForeignKeyModels() for each generated @ForeignKey.
  4. @ContentProvider generated now call down directly to the corresponding database methods. This is to simplify and prevent most other issues from coming up.
  5. Now there's an incubating dbflow-kotlinextensions! It provides some Kotlin language features such as items.processInTransactionAsync { it.save() } or 5.property.eq(SomeTable_Table.num)
  6. 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);
    }
  1. 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 new rowID param has been added to the @PrimaryKey annotation that will keep the existing way (to prevent inconsistencies).
  2. all wrapper queries now have access to hasData() which returns count() > 0.
  3. All saving, updating, deleting, and inserting is now done via a configurable ModelSaver class. All corresponding SqlUtils 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());
  1. Fix issues with TypeConverter that used Blob as its database class. Properly convert the blob to a hex string using a super-efficient algorithm.
  2. Fixed null values as strings that would insert 'null' instead of the database NULL, which could lead to head-scratching why a query like SQLite.delete(SomeTable.class).where(SomeTable_Table.column.eq(null)).execute() would fail to delete in some scenarios.
  3. _Table classes now give you access to an array of IProperty from the table via getAllColumnProperties(). Useful in queries or table information.
  4. Can attached queries as properties now: SQLite.select(SQLite.select().from(SomeTable.class).where(..)).from(SomethingElse.class).... (SELECT (SELECT * From...))
  5. Doc improvements, bug fixes and more.