brick_sqlite 0.1.1
brick_sqlite: ^0.1.1 copied to clipboard
SQLite connector for Brick, a data persistence library for Flutter
Unreleased #
0.1.1 #
- Bump SQFlite
- Remove
pathas a dependency and rely on SQFlite's default accessors when opening a database - Mark
SqliteProvider#migrateFromStringToJoinsTableas deprecated to signal that it should be removed from implementations as soon as possible. - Support migrations in SQLite >=3.26. 3.26 introduced a better way to update foreign key associations that is accessible in iOS's FMDB. However, since versions prior to 3.26 are used by Android, the foreign_keys hack is still necessary to maintain backwards compatibility. Hat tip to this SO answer.
0.1.0+2 #
- Ignore when inserting associations
0.1.0+1 #
- Fix SQL query for joins
0.1.0 #
- Add
beforeSaveanda fterSavehooks to theSqliteAdapter - BREAKING CHANGE One-to-many and many-to-many SQLite associations are no longer stored as JSON-encoded strings (i.e.
[1, 2, 3]in a varchar column). Join tables are now generated by Brick. To convert existing data, please follow the next steps carefully. If you do not care about existing migration and have not widely distributed your app, simply delete all existing migrations, delete all existing app installs, and runflutter pub run build_runner buildin your project root.- Run
flutter pub run build_runner buildin your project root. - In the created migration file, remove any
DropColumncommands from theupstatements. - Run this for each DropColumn after
super.migrate.class MyRepository extends OfflineFirstWithRestRepository { @override Future<void> migrate() async { await super.migrate(); // TODO update this table with information from the deleted `DropColumn` commands in step 2. final joinsTableColumnMigrations = [ { 'localTableName': 'User' 'columnName': 'hats', 'foreignTableName': 'Hat', }, ]; for (var entry in joinsTableColumnMigrations) { await sqliteProvider.migrateFromStringToJoinsTable(entry['columnName'], entry['localTableName'], entry['foreignTableName']); } } } - Continue to remove
DropColumnfrom generated migrations until you've safely distributed the update.
- Run
0.0.7 #
- Add
StubSqlite.queryValueForColumnto discover the passed argument for a specific column - Support OR clauses in
StubSqlite. This publicly exposesStubSqlite.queryMatchesResponse. - Bump
synchronizedandsqflitepackages to supportreentrantlocks - #52 Support multiplatform with
sqlite_ffi - BREAKING CHANGE Remove
StubSqlite.sqlite_ffiis an in-memory instance of SQLite that can be used in unit test environments.StubSqlitecan introduce edge cases not consistent with a real-world SQLite instance.
0.0.6 #
- Field names should always be used instead of column names in
Query#providerArgs: - Boolean responses from
StubSqliteare converted to 1 and 0.QuerySqlTransformerconverts input boolean values in queries to 1 or 0 to ensure they're serialized and compared properly in SQLite; this change ensures the other end performs the same conversion - Add test coverage for
StubSqlite - Fixes an edge case in the
QuerySqlTransformerwhere overlapping field names were replaced multiple times by thefieldsToColumnsmap, resulting in an improper column names
0.0.5 #
- Rename
Query#paramstoQuery#providerArgs, reflecting the much narrower purpose of the member
0.0.2 #
- Fix linter hints