brick_sqlite 3.2.0+1
brick_sqlite: ^3.2.0+1 copied to clipboard
SQLite connector for Brick, a data persistence library for Flutter
Unreleased #
3.2.0 #
- DEPRECATION
Query(providerArgs: {'collate':})is nowQuery(forProviders: [SqliteProviderQuery(collate:)]) - DEPRECATION
Query(providerArgs: {'having':})is nowQuery(forProviders: [SqliteProviderQuery(having:)]) - DEPRECATION
Query(providerArgs: {'groupBy':})is nowQuery(forProviders: [SqliteProviderQuery(groupBy:)]) - Association ordering is supported. For example,
Query(orderBy: [OrderBy.desc('assoc', associationField: 'name')])onDemoModelwill produce the following SQL statement:'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModelAssoc`.name DESC' - New
SqliteProviderQueryadds Sqlite-specific support for the newQuery. Columnenum is enhanced, performing the conversion between Dart and SQLite column types on the enum instead of inMigration.- Barrel files are no longer imported to
src/implementations - Upgrade
brick_coreto1.3.0 - Update analysis to modern lints
3.1.1 #
- Expose a generic type for
MemoryCacheProvidermodels - Expose a generic type for
SqliteProvidermodels
3.1.0 #
- Apply standardized lints
- Upgrade minimum Dart to 2.18
- Add extra documentation to the
@Sqlite(unique:)annotation
3.0.1 #
- Support Dart 3
3.0.0 #
Please follow the v3 migration guide to easily upgrade.
- Combine
brick_sqlite_abstractto this package, addingdb.dartas an export. This merge also includesSqliteSerializableandSqliteModel, both now exported bybrick_sqlite/brick_sqlite.dart - BREAKING CHANGE Rename main export
sqlite.darttobrick_sqlite.dart - Remove
brick_sqlite_abstractdependency - Add
collectionas a direct dependency - Add
transactiontoSqliteProvider - Update signature for
rawQueryto mirror Sqflite's signature
2.1.0 #
- Support deeply-nested association querying:
Where('pizza').isExactly( Where('customer').isExactly( Where('name', name) ), ) // In this example, Car, Pizza, and Customer are all independent Brick models. // Car has `final List<Pizza> pizzas` // Pizza has `final Person customer` // Customer has `final String name`
2.0.1 #
- Use the table name prefix in SQL queries for identically-named association columns
2.0.0 #
- Loosen dependency restrictions to major versions
- Privatize
SqliteProvider.MIGRATION_VERSIONS_TABLE_NAMEto_migrationVersionsTableName - BREAKING CHANGE Use
sqflite_commoninstead ofsqflite, permitting this package to be used without Flutter.
1.2.0 #
- When using a DateTime field with an operator (
ORDER BY,HAVING,GROUP BY, etc), wrap theORDER BYqueries indatetime
1.1.0 #
- Fix edge case where 'ambiguous column name' was thrown on
existsqueries with an association constraint and declaredOFFSET - Add Flutter Lints
- Change
instanceanddatapositional arguments inSqliteAdaptertoinputto match generator variable
1.0.0+1 #
- Require
providerinSqliteAdapter#fromSqlite,SqliteAdapter#toSqlite,SqliteAdapter#beforeSave,SqliteAdapter#afterSave
1.0.0 #
- Migrate to null safety
0.1.7 #
- Support
columnTypefrom SQLite annotations - When deleting many associations from a parent, remove the association in the joins table but do not delete the instance. This is only applicable to non-final instance fields. (#112)
- Support spaces in compound orderBy clauses (i.e.
'orderBy': 'firstField DESC, secondField ASC'where previously only'orderBy': 'firstField DESC,secondField ASC'worked)
0.1.6+1 #
- Fix: when non-SQLite providerArgs are provided in a query, false is no longer returned from
SqliteProvider#exists
0.1.6 #
- Internal: Change
SqliteAdpater#fieldsToSqliteColumnstype fromMap<String, Map<String, dynamic>>toMap<String, RuntimeSqliteColumnDefinition>. Using such a dynamic type option will lead to inconsistency when accessing the values. SqliteAdapter#primaryKeyByUniqueColumnwill returninstance?.primaryKeyinstead of null when no@Sqlite(unique: true)fields exist.- Internal: Refactor organization of files:
SqliteProvider,SqliteAdapter,SqliteModelDictionaryare separated.lib/sqlite.dartis now a barrel file with the same exports.
0.1.5+1 #
- Fix: recreate SQLite DB after reset instead of attempting to open a closed DB
0.1.5 #
- Access SQLite db safely to avoid race conditions
- Lint: do not use implicit types
0.1.4 #
- Handle empty conditions when constructing a statement from a
WherePhrase - SQL
COUNT(*)does not work withOFFSETclauses; run an inexpensive SELECT query instead in.existsto accomodateOFFSET
0.1.3 #
- Revise
existsin SqliteProvider to query with a SQL statement instead of hydrating whole models and associations - Add
selectStatementtoQuerySqlTransformer's default constructor. Whentrue,statementwill beginSELECT FROM; whenfalse,statementwill beginSELECT COUNT(*). Defaultstrue.
0.1.2 #
- When searching with
doesNotContainapply same fuzzy search%thatCompare.containsenjoys
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