diff --git a/MIGRATING.md b/MIGRATING.md index f9dbb030..ef8ead23 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -1,47 +1,59 @@ # Migrating Between Major Versions -## Migrating from Brick 3 to Brick 4 +In preparation for Brick 4, `Query` is migrating away from loosely-defined arguments in favor of standardized fields that can be easily deprecated and discovered by analysis. -Brick 4 away from loosely-defined `Query` arguments in favor of standardized fields that can be easily deprecated and discovered by analysis. +**`providerArgs` will be supported until Brick 4 is officially released**. -### Breaking Changes +It is still recommended you migrate to the new `Query` for new features and long-term support. -**`providerArgs` will be supported until Brick 4 is officially released**. It is still recommended you migrate to the new `Query` for better `orderBy` and `limitBy`. +## Improvements -- `Query(providerArgs: {'limit':})` is now `Query(limit:)` -- `Query(providerArgs: {'offset':})` is now `Query(offset:)` -- `Query(providerArgs: {'orderBy':})` is now `Query(orderBy:)`. This is a more significant change than `limit` or `offset`. `orderBy` is now defined by a class that permits multiple commands. For example, `'orderBy': 'name ASC'` becomes `[OrderBy('name', ascending: true)]`. First-class Brick providers (SQLite and Supabase) also support association-based querying by declaring a `model:`. +- `Query#orderBy` will support association ordering and multiple values +- `Query` is constructed with `const` +- `Query#offset` no longer requires companion `limit` parameter +- `brick_sqlite` and `brick_supabase` support association ordering. For example, `Query(orderBy: [OrderBy.desc('assoc', associationField: 'name')])` on `DemoModel` will produce the following SQL statement: + ```sql + 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModelAssoc`.name DESC' + ``` +- `brick_supabase` supports advanced limiting. For example, `Query(limitBy: [LimitBy(1, evaluatedField: 'assoc'))` is the equivalent of `.limit(1, referencedTable: 'demo_model')` -#### brick_graphql +## Universal Deprecations -- `Query(providerArgs: {'context':})` is now `Query(forProviders: [GraphqlProviderQuery(context:)])` -- `Query(providerArgs: {'operation':})` is now `Query(forProviders: [GraphqlProviderQuery(operation:)])` +| Old | New | Notes | +| ----------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Query(providerArgs: {'limit':})` | `Query(limit:)` | `limit` and `limitBy` may be used together, however, `limitBy` will only limit `evaluatedField:` associations | +| `Query(providerArgs: {'offset':})` | `Query(offset:)` | | +| `Query(providerArgs: {'orderBy':})` | `Query(orderBy:)` | `orderBy` is now defined by a class that permits multiple commands. For example, `'orderBy': 'name ASC'` becomes `[OrderBy('name', ascending: true)]`. First-class Brick providers (SQLite and Supabase) also support association-based querying by declaring a `associationField:`. This `associationField` is optional in Supabase but required for `SQLite`. | -#### brick_rest +## Package-specific deprecations -- `Query(providerArgs: {'request':})` is now `Query(forProviders: [RestProviderQuery(request:)])`. This is a similarly significant chang that allows providers to be detected by static analysis and reduces the need for manual documentation. +### brick_graphql -#### brick_sqlite +| Old | New | Notes | +| ------------------------------------- | --------------------------------------------------------- | ----- | +| `Query(providerArgs: {'context':})` | `Query(forProviders: [GraphqlProviderQuery(context:)])` | +| `Query(providerArgs: {'operation':})` | `Query(forProviders: [GraphqlProviderQuery(operation:)])` | -- `Query(providerArgs: {'collate':})` is now `Query(forProviders: [SqliteProviderQuery(collate:)])` -- `Query(providerArgs: {'having':})` is now `Query(forProviders: [SqliteProviderQuery(having:)])` -- `Query(providerArgs: {'groupBy':})` is now `Query(forProviders: [SqliteProviderQuery(groupBy:)])` +### brick_rest -#### brick_supabase +| Old | New | Notes | +| ----------------------------------- | ---------------------------------------------------- | ----- | +| `Query(providerArgs: {'request':})` | `Query(forProviders: [RestProviderQuery(request:)])` | | -- `Query(providerArgs: {'limitReferencedTable':})` has been removed in favor of `Query(limitBy:)` -- `Query(providerArgs: {'orderByReferencedTable':})` has been removed in favor of `Query(orderBy:)` +### brick_sqlite -### Improvements +| Old | New | Notes | +| ----------------------------------- | ------------------------------------------------------ | ----- | +| `Query(providerArgs: {'collate':})` | `Query(forProviders: [SqliteProviderQuery(collate:)])` | +| `Query(providerArgs: {'having':})` | `Query(forProviders: [SqliteProviderQuery(having:)])` | +| `Query(providerArgs: {'groupBy':})` | `Query(forProviders: [SqliteProviderQuery(groupBy:)])` | -- `OrderBy` will support association ordering and multiple values -- `Query` is constructed with `const` -- `Query#offset` no longer requires companion `limit` parameter -- `brick_sqlite` and `brick_supabase` support association ordering. For example, `Query(orderBy: [OrderBy.desc('name', model: DemoModelAssoc)])` on `DemoModel` will produce the following SQL statement: - ```sql - 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModelAssoc`.name DESC' - ``` -- `brick_supabase` supports advanced limiting. For example, `Query(limitBy: [LimitBy(1, model: DemoModel))` is the equivalent of `.limit(1, referencedTable: 'demo_model')` +### brick_supabase + +| Old | New | Notes | +| -------------------------------------------------- | --- | ------------------------------------- | +| `Query(providerArgs: {'limitReferencedTable':})` | | Removed in favor of `Query(limitBy:)` | +| `Query(providerArgs: {'orderByReferencedTable':})` | | Removed in favor of `Query(orderBy:)` | ## Migrating from Brick 2 to Brick 3 diff --git a/packages/brick_build/CHANGELOG.md b/packages/brick_build/CHANGELOG.md index 1a5f11b0..abca3b23 100644 --- a/packages/brick_build/CHANGELOG.md +++ b/packages/brick_build/CHANGELOG.md @@ -1,6 +1,10 @@ ## Unreleased +## 3.3.0 + - Add documentation to increase pub.dev score +- Update minimum `brick_core` to `1.3.0` +- Update analysis to modern lints ## 3.2.1 diff --git a/packages/brick_build/lib/src/builders/adapter_builder.dart b/packages/brick_build/lib/src/builders/adapter_builder.dart index bb4c55c1..57fe7037 100644 --- a/packages/brick_build/lib/src/builders/adapter_builder.dart +++ b/packages/brick_build/lib/src/builders/adapter_builder.dart @@ -3,7 +3,7 @@ import 'package:brick_build/src/utils/string_helpers.dart'; import 'package:build/build.dart'; /// Writes adapter code (model serialization/deserialization). -/// Outputs to brick/adapters/_adapter.g.dart +/// Outputs to brick/adapters/{MODEL}_adapter.g.dart class AdapterBuilder<_ClassAnnotation> extends BaseBuilder<_ClassAnnotation> { /// final AnnotationSuperGenerator generator; @@ -12,7 +12,7 @@ class AdapterBuilder<_ClassAnnotation> extends BaseBuilder<_ClassAnnotation> { final outputExtension = '.adapter_builder.dart'; /// Writes adapter code (model serialization/deserialization). - /// Outputs to brick/adapters/_adapter.g.dart + /// Outputs to brick/adapters/{MODEL}_adapter.g.dart AdapterBuilder(this.generator); @override diff --git a/packages/brick_build/pubspec.yaml b/packages/brick_build/pubspec.yaml index e168d521..3b9c9835 100644 --- a/packages/brick_build/pubspec.yaml +++ b/packages/brick_build/pubspec.yaml @@ -4,14 +4,14 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_build issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.1 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" dependencies: analyzer: ">=6.0.0 <7.0.0" - brick_core: ^1.1.1 + brick_core: ^1.3.0 build: ^2.3.0 dart_style: ">=2.0.0 <3.0.0" glob: ">=2.1.0 <3.0.0" @@ -23,6 +23,6 @@ dependencies: dev_dependencies: brick_build_test: path: ../brick_build_test - build_verify: ^2.0.0 - lints: ^2.0.1 - test: ^1.20.1 + build_verify: + lints: + test: diff --git a/packages/brick_core/CHANGELOG.md b/packages/brick_core/CHANGELOG.md index 74ac30cc..0d479345 100644 --- a/packages/brick_core/CHANGELOG.md +++ b/packages/brick_core/CHANGELOG.md @@ -1,5 +1,20 @@ ## Unreleased +## 1.3.1 + +- `const`antize `Where.exactly` and `OrderBy.{desc|asc}` +- Add deprecation annotation to `Query#copyWith#providerArgs` + +## 1.3.0 + +- **DEPRECATION** `Query(providerArgs: {'limit':})` is now `Query(limit:)` +- **DEPRECATION** `Query(providerArgs: {'offset':})` is now `Query(offset:)` +- **DEPRECATION** `Query(providerArgs: {'orderBy':})` is now `Query(orderBy:)`. `orderBy` is now defined by a class that permits multiple commands. For example, `'orderBy': 'name ASC'` becomes `[OrderBy('name', ascending: true)]`. +- **DEPRECATION** `providerArgs` will be removed in the next major release +- `OrderBy` will support association ordering and multiple values +- `Query` is constructed with `const` +- `Query#offset` no longer requires companion `limit` parameter + ## 1.2.1 - Add `FieldRename` to `FieldSerializable` diff --git a/packages/brick_core/lib/src/query/limit_by.dart b/packages/brick_core/lib/src/query/limit_by.dart index bc00782b..c157a2bb 100644 --- a/packages/brick_core/lib/src/query/limit_by.dart +++ b/packages/brick_core/lib/src/query/limit_by.dart @@ -1,34 +1,33 @@ import 'dart:convert'; -import 'package:brick_core/src/model.dart'; -import 'package:brick_core/src/model_dictionary.dart'; -import 'package:brick_core/src/provider.dart'; +import 'package:brick_core/src/adapter.dart'; /// Construct directions for a provider to limit its results. class LimitBy { - /// The ceiling for how many results can be returned for a [model]. + /// The ceiling for how many results can be returned for [evaluatedField]. final int amount; /// Some providers may support limiting based on a model retrieved by the query. - /// This [Model] should be accessible to the [Provider]'s [ModelDictionary]. - final Type model; + /// This Dart field name should be accessible to the [Adapter]'s definitions + /// (e.g. a `RuntimeSqliteColumnDefinition` map). + final String evaluatedField; /// Construct directions for a provider to limit its results. const LimitBy( this.amount, { - required this.model, + required this.evaluatedField, }); /// Construct a [LimitBy] from a JSON map. factory LimitBy.fromJson(Map json) => LimitBy( json['amount'], - model: json['model'], + evaluatedField: json['evaluatedField'], ); /// Serialize to JSON Map toJson() => { 'amount': amount, - 'model': model, + 'evaluatedField': evaluatedField, }; @override @@ -36,8 +35,9 @@ class LimitBy { @override bool operator ==(Object other) => - identical(this, other) || other is LimitBy && amount == other.amount && model == other.model; + identical(this, other) || + other is LimitBy && amount == other.amount && evaluatedField == other.evaluatedField; @override - int get hashCode => amount.hashCode ^ model.hashCode; + int get hashCode => amount.hashCode ^ evaluatedField.hashCode; } diff --git a/packages/brick_core/lib/src/query/order_by.dart b/packages/brick_core/lib/src/query/order_by.dart index 14d5276c..445195b9 100644 --- a/packages/brick_core/lib/src/query/order_by.dart +++ b/packages/brick_core/lib/src/query/order_by.dart @@ -1,10 +1,6 @@ -import 'package:brick_core/src/model.dart'; -import 'package:brick_core/src/model_dictionary.dart'; import 'package:brick_core/src/provider.dart'; -import 'package:meta/meta.dart'; /// Construct directions for a provider to sort its results. -@immutable class OrderBy { /// Defaults to `true`. final bool ascending; @@ -15,36 +11,37 @@ class OrderBy { /// and the remote source's expected name. final String evaluatedField; - /// Some providers may support ordering based on a model retrieved by the query. - /// This [Model] should be accessible to the [Provider]'s [ModelDictionary]. - final Type? model; + /// The Dart name of the field of the association model + /// if the [evaluatedField] is an association. + /// + /// If [evaluatedField] is not an association, this should be `null`. + final String? associationField; /// Construct directions for a provider to sort its results. const OrderBy( this.evaluatedField, { this.ascending = true, - this.model, + this.associationField, }); /// Sort by [ascending] order (A-Z). - factory OrderBy.asc(String evaluatedField, {Type? model}) => - OrderBy(evaluatedField, model: model); + const OrderBy.asc(this.evaluatedField, {this.associationField}) : ascending = true; /// Sort by descending order (Z-A). - factory OrderBy.desc(String evaluatedField, {Type? model}) => - OrderBy(evaluatedField, ascending: false, model: model); + const OrderBy.desc(this.evaluatedField, {this.associationField}) : ascending = false; /// Construct an [OrderBy] from a JSON map. factory OrderBy.fromJson(Map json) => OrderBy( json['evaluatedField'], ascending: json['ascending'], + associationField: json['associationField'], ); /// Serialize to JSON Map toJson() => { 'ascending': ascending, + if (associationField != null) 'associationField': associationField, 'evaluatedField': evaluatedField, - if (model != null) 'model': model?.toString(), }; @override @@ -56,8 +53,8 @@ class OrderBy { other is OrderBy && evaluatedField == other.evaluatedField && ascending == other.ascending && - model == other.model; + associationField == other.associationField; @override - int get hashCode => evaluatedField.hashCode ^ ascending.hashCode ^ model.hashCode; + int get hashCode => evaluatedField.hashCode ^ ascending.hashCode ^ associationField.hashCode; } diff --git a/packages/brick_core/lib/src/query/query.dart b/packages/brick_core/lib/src/query/query.dart index 4a618284..afb22e84 100644 --- a/packages/brick_core/lib/src/query/query.dart +++ b/packages/brick_core/lib/src/query/query.dart @@ -129,6 +129,7 @@ class Query { List? limitBy, int? offset, List? orderBy, + @Deprecated('Use limit, offset, limitBy, orderBy, or forProviders instead.') Map? providerArgs, List? where, }) => diff --git a/packages/brick_core/lib/src/query/where.dart b/packages/brick_core/lib/src/query/where.dart index d2c7cd8a..4a6f1ad1 100644 --- a/packages/brick_core/lib/src/query/where.dart +++ b/packages/brick_core/lib/src/query/where.dart @@ -136,8 +136,9 @@ class Where extends WhereCondition { conditions = null; /// A condition written with brevity. [isRequired] defaults `true`. - factory Where.exact(String evaluatedField, value, {bool isRequired = true}) => - Where(evaluatedField, value: value, compare: Compare.exact, isRequired: isRequired); + const Where.exact(this.evaluatedField, this.value, {this.isRequired = true}) + : compare = Compare.exact, + conditions = null; /// Convenience function to create a [Where] with [Compare.exact]. Where isExactly(dynamic value) => diff --git a/packages/brick_core/pubspec.yaml b/packages/brick_core/pubspec.yaml index 3755e959..bf5c9326 100644 --- a/packages/brick_core/pubspec.yaml +++ b/packages/brick_core/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_core issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 2.0.0 +version: 1.3.1 environment: sdk: ">=3.0.0 <4.0.0" @@ -13,7 +13,6 @@ dependencies: collection: ">=1.15.0 <2.0.0" dev_dependencies: - dart_style: ">=2.0.0 <3.0.0" - lints: ">=4.0.0 <6.0.0" - mockito: ^5.0.0 - test: ^1.16.5 + lints: + mockito: + test: diff --git a/packages/brick_core/test/query/limit_by_test.dart b/packages/brick_core/test/query/limit_by_test.dart index 9d2afbcd..1dcc6b54 100644 --- a/packages/brick_core/test/query/limit_by_test.dart +++ b/packages/brick_core/test/query/limit_by_test.dart @@ -5,26 +5,22 @@ void main() { group('LimitBy', () { test('equality', () { expect( - const LimitBy(2, model: num), - LimitBy.fromJson(const {'amount': 2, 'model': num}), + const LimitBy(2, evaluatedField: 'name'), + LimitBy.fromJson(const {'amount': 2, 'evaluatedField': 'name'}), ); }); test('#toJson', () { expect( - const LimitBy(2, model: int).toJson(), - {'amount': 2, 'model': int}, - ); - expect( - const LimitBy(2, model: String).toJson(), - {'amount': 2, 'model': String}, + const LimitBy(2, evaluatedField: 'name').toJson(), + {'amount': 2, 'evaluatedField': 'name'}, ); }); test('.fromJson', () { expect( - LimitBy.fromJson(const {'amount': 2, 'model': String}), - const LimitBy(2, model: String), + LimitBy.fromJson(const {'amount': 2, 'evaluatedField': 'longerName'}), + const LimitBy(2, evaluatedField: 'longerName'), ); }); }); diff --git a/packages/brick_core/test/query/order_by_test.dart b/packages/brick_core/test/query/order_by_test.dart index 29672e0f..a2f1b9a6 100644 --- a/packages/brick_core/test/query/order_by_test.dart +++ b/packages/brick_core/test/query/order_by_test.dart @@ -5,12 +5,16 @@ void main() { group('OrderBy', () { test('equality', () { expect( - const OrderBy('name'), - OrderBy.fromJson(const {'evaluatedField': 'name', 'ascending': true}), + const OrderBy('name', associationField: 'assoc'), + OrderBy.fromJson( + const {'evaluatedField': 'name', 'ascending': true, 'associationField': 'assoc'}, + ), ); expect( - const OrderBy('name', ascending: false), - OrderBy.fromJson(const {'evaluatedField': 'name', 'ascending': false}), + const OrderBy('name', ascending: false, associationField: 'assoc'), + OrderBy.fromJson( + const {'evaluatedField': 'name', 'ascending': false, 'associationField': 'assoc'}, + ), ); }); @@ -20,8 +24,8 @@ void main() { {'evaluatedField': 'name', 'ascending': true}, ); expect( - const OrderBy('name', ascending: false).toJson(), - {'evaluatedField': 'name', 'ascending': false}, + const OrderBy('name', ascending: false, associationField: 'assoc').toJson(), + {'evaluatedField': 'name', 'ascending': false, 'associationField': 'assoc'}, ); }); @@ -34,14 +38,26 @@ void main() { const OrderBy('name', ascending: false).toString(), 'name DESC', ); + expect( + const OrderBy('name', ascending: false, associationField: 'assoc').toString(), + 'name DESC', + ); }); test('.asc', () { - expect(OrderBy.asc('name'), const OrderBy('name')); + expect(const OrderBy.asc('name'), const OrderBy('name')); + expect( + const OrderBy.asc('name', associationField: 'assoc'), + const OrderBy('name', associationField: 'assoc'), + ); }); test('.desc', () { - expect(OrderBy.desc('name'), const OrderBy('name', ascending: false)); + expect(const OrderBy.desc('name'), const OrderBy('name', ascending: false)); + expect( + const OrderBy.desc('name', associationField: 'assoc'), + const OrderBy('name', ascending: false, associationField: 'assoc'), + ); }); test('.fromJson', () { @@ -53,6 +69,12 @@ void main() { OrderBy.fromJson(const {'evaluatedField': 'name', 'ascending': false}), const OrderBy('name', ascending: false), ); + expect( + OrderBy.fromJson( + const {'evaluatedField': 'name', 'ascending': false, 'associationField': 'assoc'}, + ), + const OrderBy('name', ascending: false, associationField: 'assoc'), + ); }); }); } diff --git a/packages/brick_core/test/query/where_test.dart b/packages/brick_core/test/query/where_test.dart index a778861c..096d7532 100644 --- a/packages/brick_core/test/query/where_test.dart +++ b/packages/brick_core/test/query/where_test.dart @@ -93,7 +93,7 @@ void main() { group('.firstByField', () { test('single field', () { - final conditions = [Where.exact('id', 1), Where.exact('name', 'Thomas')]; + final conditions = [const Where.exact('id', 1), const Where.exact('name', 'Thomas')]; final result = Where.firstByField('id', conditions); expect(result, conditions.first); }); diff --git a/packages/brick_graphql/CHANGELOG.md b/packages/brick_graphql/CHANGELOG.md index 91d03358..5d660010 100644 --- a/packages/brick_graphql/CHANGELOG.md +++ b/packages/brick_graphql/CHANGELOG.md @@ -1,5 +1,13 @@ ## Unreleased +## 3.2.0 + +- **DEPRECATION** `Query(providerArgs: {'context':})` is now `Query(forProviders: [GraphqlProviderQuery(context:)])` +- **DEPRECATION** `Query(providerArgs: {'operation':})` is now `Query(forProviders: [GraphqlProviderQuery(operation:)])` +- New `GraphqlProviderQuery` adds GraphQL-specific support for the new `Query`. +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.1.2 - Loosen constraints for `gql`, `gql_exec`, and `gql_link` diff --git a/packages/brick_graphql/pubspec.yaml b/packages/brick_graphql/pubspec.yaml index c7a26950..b84a8471 100644 --- a/packages/brick_graphql/pubspec.yaml +++ b/packages/brick_graphql/pubspec.yaml @@ -10,7 +10,7 @@ environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.2.1 + brick_core: ^1.3.0 collection: ">=1.15.0 <2.0.0" gql: ">=0.13.0 <2.0.0" gql_exec: ">=0.3.0 <2.0.0" @@ -19,6 +19,6 @@ dependencies: meta: ">=1.3.0 <2.0.0" dev_dependencies: - lints: ^2.0.1 - mockito: ^5.0.0 - test: ^1.16.5 + lints: + mockito: + test: diff --git a/packages/brick_graphql_generators/CHANGELOG.md b/packages/brick_graphql_generators/CHANGELOG.md index cf3c236f..069fc8d1 100644 --- a/packages/brick_graphql_generators/CHANGELOG.md +++ b/packages/brick_graphql_generators/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 3.3.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.2.1 - Use `renameField` from `brick_build`'s `AnnotationFinderWithFieldRename` mixin diff --git a/packages/brick_graphql_generators/pubspec.yaml b/packages/brick_graphql_generators/pubspec.yaml index 72d38453..2c5ed90e 100644 --- a/packages/brick_graphql_generators/pubspec.yaml +++ b/packages/brick_graphql_generators/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_graphql_g issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.1 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.2.0 <4.0.0" - brick_core: ">=1.2.1 <2.0.0" + brick_core: ">=1.3.0 <2.0.0" brick_graphql: ">=3.0.0 <4.0.0" brick_json_generators: ">=3.0.0 <4.0.0" build: ">=2.0.0 <3.0.0" diff --git a/packages/brick_json_generators/CHANGELOG.md b/packages/brick_json_generators/CHANGELOG.md index 51e5f28a..52b0c150 100644 --- a/packages/brick_json_generators/CHANGELOG.md +++ b/packages/brick_json_generators/CHANGELOG.md @@ -2,6 +2,8 @@ - (test) remove analysis options override for non-standard library prefixes - Revert `.getDisplayString()` change due to Flutter 3.22 being restricted to analyzer <6.4.1. `meta` is pinned to `1.12` in this version of Flutter, and `analyzer >=6.5.0`, where the change was made, requires `meta >= 1.15`. This change will eventually be re-reverted. +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints ## 3.1.1 diff --git a/packages/brick_json_generators/pubspec.yaml b/packages/brick_json_generators/pubspec.yaml index 858500ba..01e91202 100644 --- a/packages/brick_json_generators/pubspec.yaml +++ b/packages/brick_json_generators/pubspec.yaml @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.0.0 <4.0.0" - brick_core: ^1.1.1 + brick_core: ^1.3.0 build: ">=2.0.0 <3.0.0" dart_style: ">=2.0.0 <3.0.0" source_gen: ">=1.2.2 <2.0.0" diff --git a/packages/brick_offline_first/CHANGELOG.md b/packages/brick_offline_first/CHANGELOG.md index a71b01e2..c9fef904 100644 --- a/packages/brick_offline_first/CHANGELOG.md +++ b/packages/brick_offline_first/CHANGELOG.md @@ -2,6 +2,8 @@ ## 3.4.0 +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints - Change `OfflineFirstRepository#exists` behavior: the check against memory cache will only return `true` if results have been found, otherwise it will continue to the SQLite provider - Forward errors from `OfflineFirstRepository#subscribe` streams to their callers (@sonbs21 #484) diff --git a/packages/brick_offline_first/pubspec.yaml b/packages/brick_offline_first/pubspec.yaml index 69906f92..55ed7f51 100644 --- a/packages/brick_offline_first/pubspec.yaml +++ b/packages/brick_offline_first/pubspec.yaml @@ -11,7 +11,7 @@ environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.1.1 + brick_core: ^1.3.0 brick_sqlite: ">=3.0.0 <4.0.0" collection: ">=1.15.0 <2.0.0" dart_style: ">=2.0.0 <3.0.0" diff --git a/packages/brick_offline_first_build/CHANGELOG.md b/packages/brick_offline_first_build/CHANGELOG.md index 39aeabaa..ee2ea182 100644 --- a/packages/brick_offline_first_build/CHANGELOG.md +++ b/packages/brick_offline_first_build/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 3.3.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.2.1 - (test) remove analysis options override for non-standard library prefixes diff --git a/packages/brick_offline_first_build/pubspec.yaml b/packages/brick_offline_first_build/pubspec.yaml index 66a0a1ad..6ceb84df 100644 --- a/packages/brick_offline_first_build/pubspec.yaml +++ b/packages/brick_offline_first_build/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.1 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.0.0 <4.0.0" - brick_core: ^1.1.1 + brick_core: ^1.3.0 brick_json_generators: ">=3.0.0 <4.0.0" brick_offline_first: ">=3.0.0 <4.0.0" brick_sqlite: ">=3.0.0 <4.0.0" diff --git a/packages/brick_offline_first_with_graphql/CHANGELOG.md b/packages/brick_offline_first_with_graphql/CHANGELOG.md index 8ceb3047..b2dc86b2 100644 --- a/packages/brick_offline_first_with_graphql/CHANGELOG.md +++ b/packages/brick_offline_first_with_graphql/CHANGELOG.md @@ -1,6 +1,8 @@ ## Unreleased - Allow a generic type argument for `OfflineFirstWithGraphqlRepository` +- Update analysis to modern lints +- Upgrade `brick_core` to `1.3.0` ## 3.2.0 diff --git a/packages/brick_offline_first_with_graphql/pubspec.yaml b/packages/brick_offline_first_with_graphql/pubspec.yaml index bbf5d0bb..573c017b 100644 --- a/packages/brick_offline_first_with_graphql/pubspec.yaml +++ b/packages/brick_offline_first_with_graphql/pubspec.yaml @@ -5,13 +5,13 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.0 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.1.1 + brick_core: ^1.3.0 brick_graphql: ">=3.0.0 <4.0.0" brick_offline_first: ">=3.0.0 <4.0.0" brick_sqlite: ">=3.0.0 <4.0.0" diff --git a/packages/brick_offline_first_with_graphql_build/CHANGELOG.md b/packages/brick_offline_first_with_graphql_build/CHANGELOG.md index 4b50212c..da0ae94e 100644 --- a/packages/brick_offline_first_with_graphql_build/CHANGELOG.md +++ b/packages/brick_offline_first_with_graphql_build/CHANGELOG.md @@ -2,6 +2,7 @@ - (test) remove analysis options override for non-standard library prefixes - Apply minimum constraint on `brick_offline_first_build` to `3.2.0` +- Update analysis to modern lints ## 3.3.0 diff --git a/packages/brick_offline_first_with_graphql_build/pubspec.yaml b/packages/brick_offline_first_with_graphql_build/pubspec.yaml index dd17d867..27956e43 100644 --- a/packages/brick_offline_first_with_graphql_build/pubspec.yaml +++ b/packages/brick_offline_first_with_graphql_build/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: dev_dependencies: brick_build_test: path: ../brick_build_test - brick_core: ^1.1.1 + brick_core: build_verify: lints: source_gen_test: diff --git a/packages/brick_offline_first_with_rest/CHANGELOG.md b/packages/brick_offline_first_with_rest/CHANGELOG.md index 9a51f39e..b0084486 100644 --- a/packages/brick_offline_first_with_rest/CHANGELOG.md +++ b/packages/brick_offline_first_with_rest/CHANGELOG.md @@ -1,6 +1,11 @@ ## Unreleased +## 3.3.0 + - Allow a generic type argument for `OfflineFirstWithRestRepository` +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints +- `OfflineFirstException` has been moved to the `brick_offline_first` package ## 3.2.0 diff --git a/packages/brick_offline_first_with_rest/pubspec.yaml b/packages/brick_offline_first_with_rest/pubspec.yaml index 8b022c40..59f592c1 100644 --- a/packages/brick_offline_first_with_rest/pubspec.yaml +++ b/packages/brick_offline_first_with_rest/pubspec.yaml @@ -5,13 +5,13 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.0 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.1.1 + brick_core: ^1.3.0 brick_offline_first: ">=3.0.0 <4.0.0" brick_rest: ">=3.0.3 <4.0.0" brick_sqlite: ">=3.0.0 <4.0.0" diff --git a/packages/brick_offline_first_with_rest_build/CHANGELOG.md b/packages/brick_offline_first_with_rest_build/CHANGELOG.md index 1adbf887..15d87df8 100644 --- a/packages/brick_offline_first_with_rest_build/CHANGELOG.md +++ b/packages/brick_offline_first_with_rest_build/CHANGELOG.md @@ -1,10 +1,10 @@ ## Unreleased -- (test) remove analysis options override for non-standard library prefixes -- Apply minimum constraint on `brick_offline_first_build` to `3.2.0` - ## 3.2.0 +- (test) remove analysis options override for non-standard library prefixes +- Apply minimum constraint on `brick_offline_first_build` to `3.2.0` +- Upgrade `brick_core` to `1.3.0` - Apply standardized lints - Update `analyzer` constraints to `>=6.0.0 <7.0.0` - Format CHANGELOG.md diff --git a/packages/brick_offline_first_with_rest_build/pubspec.yaml b/packages/brick_offline_first_with_rest_build/pubspec.yaml index 5abab96e..2109a14c 100644 --- a/packages/brick_offline_first_with_rest_build/pubspec.yaml +++ b/packages/brick_offline_first_with_rest_build/pubspec.yaml @@ -29,6 +29,7 @@ dependencies: dev_dependencies: brick_build_test: path: ../brick_build_test + brick_core: build_verify: lints: source_gen_test: diff --git a/packages/brick_offline_first_with_supabase/CHANGELOG.md b/packages/brick_offline_first_with_supabase/CHANGELOG.md index 936ea7e1..d0bf080f 100644 --- a/packages/brick_offline_first_with_supabase/CHANGELOG.md +++ b/packages/brick_offline_first_with_supabase/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 1.2.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 1.1.2 - Support a custom database path when creating the cache manager (#490) diff --git a/packages/brick_offline_first_with_supabase/pubspec.yaml b/packages/brick_offline_first_with_supabase/pubspec.yaml index cc4cb577..08248487 100644 --- a/packages/brick_offline_first_with_supabase/pubspec.yaml +++ b/packages/brick_offline_first_with_supabase/pubspec.yaml @@ -5,13 +5,13 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 1.1.2 +version: 1.2.0 environment: sdk: ">=3.0.0 <4.0.0" dependencies: - brick_core: ">=1.2.0 <2.0.0" + brick_core: ">=1.3.0 <2.0.0" brick_offline_first: ">=3.0.0 <4.0.0" brick_offline_first_with_rest: ">=3.1.0 <4.0.0" brick_sqlite: ">=3.0.0 <4.0.0" diff --git a/packages/brick_offline_first_with_supabase/test/offline_first_with_supabase_repository_test.dart b/packages/brick_offline_first_with_supabase/test/offline_first_with_supabase_repository_test.dart index 7e68c58a..3679b247 100644 --- a/packages/brick_offline_first_with_supabase/test/offline_first_with_supabase_repository_test.dart +++ b/packages/brick_offline_first_with_supabase/test/offline_first_with_supabase_repository_test.dart @@ -214,7 +214,7 @@ void main() async { group('#queryToPostgresChangeFilter', () { group('returns null', () { test('for complex queries', () { - final query = Query.where('pizza', Where.exact('id', 2)); + final query = Query.where('pizza', const Where.exact('id', 2)); expect(repository.queryToPostgresChangeFilter(query), isNull); }); @@ -243,7 +243,7 @@ void main() async { }); test('.exact', () { - final query = Query(where: [Where.exact('firstName', 'Thomas')]); + const query = Query(where: [Where.exact('firstName', 'Thomas')]); final filter = repository.queryToPostgresChangeFilter(query); expect(filter!.type, PostgresChangeFilterType.eq); diff --git a/packages/brick_offline_first_with_supabase_build/CHANGELOG.md b/packages/brick_offline_first_with_supabase_build/CHANGELOG.md index 80618179..b1d7e058 100644 --- a/packages/brick_offline_first_with_supabase_build/CHANGELOG.md +++ b/packages/brick_offline_first_with_supabase_build/CHANGELOG.md @@ -1,6 +1,9 @@ ## Unreleased +## 1.1.0 + - Add documentation to increase pub.dev score +- Update analysis to modern lints ## 1.0.0 diff --git a/packages/brick_offline_first_with_supabase_build/pubspec.yaml b/packages/brick_offline_first_with_supabase_build/pubspec.yaml index 36973292..6543bc26 100644 --- a/packages/brick_offline_first_with_supabase_build/pubspec.yaml +++ b/packages/brick_offline_first_with_supabase_build/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_offline_f issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 1.0.0 +version: 1.1.0 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/brick_rest/CHANGELOG.md b/packages/brick_rest/CHANGELOG.md index 39396c91..17784390 100644 --- a/packages/brick_rest/CHANGELOG.md +++ b/packages/brick_rest/CHANGELOG.md @@ -1,5 +1,12 @@ ## Unreleased +## 3.1.0 + +- **DEPRECATION** `Query(providerArgs: {'request':})` is now `Query(forProviders: [RestProviderQuery(request:)])`. +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints +- New `RestProviderQuery` adds REST-specific support for the new `Query`. + ## 3.0.4 - Access `FieldRename` from `brick_core` instead of declaring within this package diff --git a/packages/brick_rest/pubspec.yaml b/packages/brick_rest/pubspec.yaml index 83c341d8..c640395e 100644 --- a/packages/brick_rest/pubspec.yaml +++ b/packages/brick_rest/pubspec.yaml @@ -4,13 +4,13 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_rest issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.0.4 +version: 3.1.0 environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.2.1 + brick_core: ^1.3.0 http: ">=1.0.0 <2.0.0" logging: ">=1.0.0 <2.0.0" meta: ">=1.3.0 <2.0.0" diff --git a/packages/brick_rest_generators/CHANGELOG.md b/packages/brick_rest_generators/CHANGELOG.md index 6fbee7b0..8b8beefb 100644 --- a/packages/brick_rest_generators/CHANGELOG.md +++ b/packages/brick_rest_generators/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 3.3.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.2.1 - Use `renameField` from `brick_build`'s `AnnotationFinderWithFieldRename` mixin diff --git a/packages/brick_rest_generators/pubspec.yaml b/packages/brick_rest_generators/pubspec.yaml index 1379cf74..bdd43532 100644 --- a/packages/brick_rest_generators/pubspec.yaml +++ b/packages/brick_rest_generators/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_rest_gene issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.1 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.2.0 <4.0.0" - brick_core: ">=1.2.1 <2.0.0" + brick_core: ">=1.3.0 <2.0.0" brick_json_generators: ">=3.0.0 <4.0.0" brick_rest: ">=3.0.4 <4.0.0" build: ">=2.0.0 <3.0.0" diff --git a/packages/brick_sqlite/CHANGELOG.md b/packages/brick_sqlite/CHANGELOG.md index 98c45907..03601644 100644 --- a/packages/brick_sqlite/CHANGELOG.md +++ b/packages/brick_sqlite/CHANGELOG.md @@ -1,5 +1,24 @@ ## Unreleased +## 3.2.1 + +- Remove `dart:io` dependency + +## 3.2.0 + +- **DEPRECATION** `Query(providerArgs: {'collate':})` is now `Query(forProviders: [SqliteProviderQuery(collate:)])` +- **DEPRECATION** `Query(providerArgs: {'having':})` is now `Query(forProviders: [SqliteProviderQuery(having:)])` +- **DEPRECATION** `Query(providerArgs: {'groupBy':})` is now `Query(forProviders: [SqliteProviderQuery(groupBy:)])` +- Association ordering is supported. For example, `Query(orderBy: [OrderBy.desc('assoc', associationField: 'name')])` on `DemoModel` will produce the following SQL statement: + ```sql + 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModelAssoc`.name DESC' + ``` +- New `SqliteProviderQuery` adds Sqlite-specific support for the new `Query`. +- `Column` enum is enhanced, performing the conversion between Dart and SQLite column types on the enum instead of in `Migration`. +- Barrel files are no longer imported to `src/` implementations +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.1.1 - Expose a generic type for `MemoryCacheProvider` models diff --git a/packages/brick_sqlite/lib/src/db/migration_manager.dart b/packages/brick_sqlite/lib/src/db/migration_manager.dart index 21e7408f..d2835cdd 100644 --- a/packages/brick_sqlite/lib/src/db/migration_manager.dart +++ b/packages/brick_sqlite/lib/src/db/migration_manager.dart @@ -1,4 +1,5 @@ -import 'package:brick_sqlite/db.dart'; +import 'package:brick_sqlite/src/db/migration.dart'; +import 'package:brick_sqlite/src/db/schema/schema.dart'; import 'package:meta/meta.dart'; /// Holds all migrations and outputs statements for SQLite to consume diff --git a/packages/brick_sqlite/lib/src/db/schema/schema_difference.dart b/packages/brick_sqlite/lib/src/db/schema/schema_difference.dart index 3df080b8..0c2e4472 100644 --- a/packages/brick_sqlite/lib/src/db/schema/schema_difference.dart +++ b/packages/brick_sqlite/lib/src/db/schema/schema_difference.dart @@ -1,4 +1,11 @@ -import 'package:brick_sqlite/db.dart'; +import 'package:brick_sqlite/src/db/migration.dart'; +import 'package:brick_sqlite/src/db/migration_commands/drop_column.dart'; +import 'package:brick_sqlite/src/db/migration_commands/drop_table.dart'; +import 'package:brick_sqlite/src/db/migration_commands/migration_command.dart'; +import 'package:brick_sqlite/src/db/schema/schema.dart'; +import 'package:brick_sqlite/src/db/schema/schema_column.dart'; +import 'package:brick_sqlite/src/db/schema/schema_index.dart'; +import 'package:brick_sqlite/src/db/schema/schema_table.dart'; import 'package:collection/collection.dart'; /// Compares two schemas to produce migrations that conver the difference diff --git a/packages/brick_sqlite/lib/src/helpers/query_sql_transformer.dart b/packages/brick_sqlite/lib/src/helpers/query_sql_transformer.dart index d40a75b0..3a1a24eb 100644 --- a/packages/brick_sqlite/lib/src/helpers/query_sql_transformer.dart +++ b/packages/brick_sqlite/lib/src/helpers/query_sql_transformer.dart @@ -382,13 +382,17 @@ class AllOtherClausesFragment { if (query?.limit != null) 'limit': query?.limit, if (query?.offset != null) 'offset': query?.offset, if (query?.orderBy.isNotEmpty ?? false) - 'orderBy': query?.orderBy - .map( - (p) => p.model != null - ? '`${modelDictionary.adapterFor[p.model]?.tableName}`.${modelDictionary.adapterFor[p.model]?.fieldsToSqliteColumns[p.evaluatedField]?.columnName} ${p.ascending ? 'ASC' : 'DESC'}' - : p.toString(), - ) - .join(', '), + 'orderBy': query?.orderBy.map((p) { + final isAssociation = fieldsToColumns[p.evaluatedField]?.association ?? false; + if (!isAssociation) return p.toString(); + + if (p.associationField == null) return p.toString(); + + final associationAdapter = + modelDictionary.adapterFor[fieldsToColumns[p.evaluatedField]?.type]; + + return '`${associationAdapter?.tableName}`.${associationAdapter?.fieldsToSqliteColumns[p.associationField]?.columnName} ${p.ascending ? 'ASC' : 'DESC'}'; + }).join(', '), if (providerQuery?.groupBy != null) 'groupBy': providerQuery?.groupBy, if (providerQuery?.having != null) 'having': providerQuery?.having, }; diff --git a/packages/brick_sqlite/lib/src/sqlite_provider.dart b/packages/brick_sqlite/lib/src/sqlite_provider.dart index 165c820d..f3e95c93 100644 --- a/packages/brick_sqlite/lib/src/sqlite_provider.dart +++ b/packages/brick_sqlite/lib/src/sqlite_provider.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:brick_core/core.dart'; import 'package:brick_sqlite/src/db/migration.dart'; import 'package:brick_sqlite/src/db/migration_commands/insert_table.dart'; @@ -250,17 +248,13 @@ class SqliteProvider implements Provider resetDb() async { - try { - await (await getDb()).close(); + await (await getDb()).close(); - await databaseFactory.deleteDatabase(dbName); + await databaseFactory.deleteDatabase(dbName); - // recreate - _openDb = null; - await getDb(); - } on FileSystemException { - // noop - } + // recreate + _openDb = null; + await getDb(); } /// Perform actions within a database transaction. diff --git a/packages/brick_sqlite/pubspec.yaml b/packages/brick_sqlite/pubspec.yaml index aa9c204f..45465e01 100644 --- a/packages/brick_sqlite/pubspec.yaml +++ b/packages/brick_sqlite/pubspec.yaml @@ -4,13 +4,13 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_sqlite issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.1.1+1 +version: 3.2.1 environment: sdk: ">=2.18.0 <4.0.0" dependencies: - brick_core: ^1.1.1 + brick_core: ^1.3.0 collection: ">=1.0.0 <2.0.0" logging: ">=1.0.0 <2.0.0" meta: ">=1.3.0 <2.0.0" diff --git a/packages/brick_sqlite/test/memory_cache_provider_test.dart b/packages/brick_sqlite/test/memory_cache_provider_test.dart index c04a7c95..0f91be63 100644 --- a/packages/brick_sqlite/test/memory_cache_provider_test.dart +++ b/packages/brick_sqlite/test/memory_cache_provider_test.dart @@ -55,7 +55,7 @@ void main() { final instance = Person()..primaryKey = 1; provider.hydrate([instance]); final results = provider.get( - query: Query( + query: const Query( where: [Where.exact(InsertTable.PRIMARY_KEY_FIELD, 1)], limit: 1, ), diff --git a/packages/brick_sqlite/test/query_sql_transformer_test.dart b/packages/brick_sqlite/test/query_sql_transformer_test.dart index 6e93df34..a25dbc17 100644 --- a/packages/brick_sqlite/test/query_sql_transformer_test.dart +++ b/packages/brick_sqlite/test/query_sql_transformer_test.dart @@ -107,17 +107,17 @@ void main() { query: Query( where: [ WherePhrase([ - Where.exact('id', 1), + const Where.exact('id', 1), const Or('name').isExactly('Guy'), ]), - WherePhrase( + const WherePhrase( [ Where.exact('id', 1), Where.exact('name', 'Guy'), ], isRequired: true, ), - WherePhrase([ + const WherePhrase([ Where.exact('id', 1), Where.exact('name', 'Guy'), ]), @@ -137,7 +137,7 @@ void main() { modelDictionary: dictionary, query: Query( where: [ - Where.exact('id', 1), + const Where.exact('id', 1), WherePhrase( [ const Or('name').isExactly('Thomas'), @@ -194,17 +194,17 @@ void main() { query: Query( where: [ WherePhrase([ - Where.exact('id', 1), + const Where.exact('id', 1), const Or('name').isExactly('Guy'), ]), - WherePhrase( + const WherePhrase( [ Where.exact('id', 1), Where.exact('name', 'Guy'), ], isRequired: true, ), - WherePhrase([ + const WherePhrase([ Where.exact('id', 1), Where.exact('name', 'Guy'), ]), @@ -223,7 +223,7 @@ void main() { 'SELECT COUNT(*) FROM `DemoModel` INNER JOIN `DemoModelAssoc` ON `DemoModel`.assoc_DemoModelAssoc_brick_id = `DemoModelAssoc`._brick_id WHERE `DemoModelAssoc`.id = ?'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( where: [ Where.exact('assoc', Where.exact('id', 1)), ], @@ -241,7 +241,7 @@ void main() { 'SELECT COUNT(*) FROM `DemoModel` INNER JOIN `DemoModelAssoc` ON `DemoModel`.assoc_DemoModelAssoc_brick_id = `DemoModelAssoc`._brick_id WHERE `DemoModelAssoc`.id = ? AND `DemoModel`.id = ?'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( where: [ Where.exact('assoc', Where.exact('id', 1)), Where.exact('id', 1), @@ -279,7 +279,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` INNER JOIN `DemoModelAssoc` ON `DemoModel`.assoc_DemoModelAssoc_brick_id = `DemoModelAssoc`._brick_id WHERE `DemoModelAssoc`.id = ?'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( where: [ Where.exact('assoc', Where.exact('id', 1)), ], @@ -296,7 +296,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` INNER JOIN `_brick_DemoModel_many_assoc` ON `DemoModel`._brick_id = `_brick_DemoModel_many_assoc`.l_DemoModel_brick_id INNER JOIN `DemoModelAssoc` ON `DemoModelAssoc`._brick_id = `_brick_DemoModel_many_assoc`.f_DemoModelAssoc_brick_id WHERE `DemoModelAssoc`.full_name = ?'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( where: [ Where.exact('manyAssoc', Where.exact('assoc', Where.exact('name', 1))), ], @@ -336,7 +336,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` INNER JOIN `_brick_DemoModel_many_assoc` ON `DemoModel`._brick_id = `_brick_DemoModel_many_assoc`.l_DemoModel_brick_id INNER JOIN `DemoModelAssoc` ON `DemoModelAssoc`._brick_id = `_brick_DemoModel_many_assoc`.f_DemoModelAssoc_brick_id WHERE `DemoModelAssoc`.id = ?'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( where: [ Where.exact( 'manyAssoc', @@ -588,7 +588,7 @@ void main() { const statement = 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel`'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: const Query(limitBy: [LimitBy(1, model: DemoModelAssoc)]), + query: const Query(limitBy: [LimitBy(1, evaluatedField: 'name')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -613,7 +613,7 @@ void main() { const statement = 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY id DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('id')]), + query: const Query(orderBy: [OrderBy.desc('id')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -626,7 +626,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY last_name DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('lastName')]), + query: const Query(orderBy: [OrderBy.desc('lastName')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -639,7 +639,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY many_assoc DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('manyAssoc')]), + query: const Query(orderBy: [OrderBy.desc('manyAssoc')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -652,7 +652,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY many_assoc DESC, complex_field_name ASC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( orderBy: [OrderBy.desc('manyAssoc'), OrderBy.asc('complexFieldName')], ), ); @@ -668,10 +668,10 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY complex_field_name ASC GROUP BY complex_field_name HAVING complex_field_name > 1000'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query( + query: const Query( orderBy: [OrderBy.asc('complexFieldName')], forProviders: [ - const SqliteProviderQuery( + SqliteProviderQuery( having: 'complexFieldName > 1000', groupBy: 'complexFieldName', ), @@ -690,7 +690,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY datetime(simple_time) DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('simpleTime')]), + query: const Query(orderBy: [OrderBy.desc('simpleTime')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -707,7 +707,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY complex_field_name DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('complex_field_name')]), + query: const Query(orderBy: [OrderBy.desc('complex_field_name')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); @@ -720,7 +720,7 @@ void main() { 'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModelAssoc`.full_name DESC'; final sqliteQuery = QuerySqlTransformer( modelDictionary: dictionary, - query: Query(orderBy: [OrderBy.desc('name', model: DemoModelAssoc)]), + query: const Query(orderBy: [OrderBy.desc('assoc', associationField: 'name')]), ); await db.rawQuery(sqliteQuery.statement, sqliteQuery.values); diff --git a/packages/brick_sqlite/test/sqlite_provider_test.dart b/packages/brick_sqlite/test/sqlite_provider_test.dart index d60070b8..1c1e0dc7 100644 --- a/packages/brick_sqlite/test/sqlite_provider_test.dart +++ b/packages/brick_sqlite/test/sqlite_provider_test.dart @@ -1,6 +1,5 @@ import 'package:brick_core/core.dart'; import 'package:brick_sqlite/brick_sqlite.dart'; -import 'package:brick_sqlite/db.dart'; import 'package:brick_sqlite/src/db/migration_commands/insert_table.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; import 'package:test/test.dart'; diff --git a/packages/brick_sqlite_generators/CHANGELOG.md b/packages/brick_sqlite_generators/CHANGELOG.md index cfc91ccc..68770898 100644 --- a/packages/brick_sqlite_generators/CHANGELOG.md +++ b/packages/brick_sqlite_generators/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 3.3.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 3.2.2 - Revert `.getDisplayString()` change due to Flutter 3.22 being restricted to analyzer <6.4.1. `meta` is pinned to `1.12` in this version of Flutter, and `analyzer >=6.5.0`, where the change was made, requires `meta >= 1.15`. This change will eventually be re-reverted. diff --git a/packages/brick_sqlite_generators/pubspec.yaml b/packages/brick_sqlite_generators/pubspec.yaml index bb9142d0..7a932b61 100644 --- a/packages/brick_sqlite_generators/pubspec.yaml +++ b/packages/brick_sqlite_generators/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_sqlite_ge issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 3.2.2 +version: 3.3.0 environment: sdk: ">=2.18.0 <4.0.0" @@ -12,6 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.2.0 <4.0.0" + brick_core: ">=1.3.0 <2.0.0" brick_sqlite: ">=3.0.0 <4.0.0" build: ">=2.0.0 <3.0.0" dart_style: ">=2.0.0 <3.0.0" diff --git a/packages/brick_supabase/CHANGELOG.md b/packages/brick_supabase/CHANGELOG.md index f0426783..24a1b50a 100644 --- a/packages/brick_supabase/CHANGELOG.md +++ b/packages/brick_supabase/CHANGELOG.md @@ -2,6 +2,16 @@ ## 1.2.0 +- **DEPRECATION** `Query(providerArgs: {'limitReferencedTable':})` has been removed in favor of `Query(limitBy:)` +- **DEPRECATION** `Query(providerArgs: {'orderByReferencedTable':})` has been removed in favor of `Query(orderBy:)` +- Association, plural ordering is supported. For example, `Query(orderBy: [OrderBy.desc('assoc', associationField: 'name')])` on `DemoModel` would produce the PostgREST filter: + ```javascript + orderBy('name', referencedTable: 'association_table') + ``` +- New `SupabaseProviderQuery` adds Supabase-specific support for the new `Query`. +- Advanced, plural limiting is supported. For example, `Query(limitBy: [LimitBy(1, evaluatedField: 'assoc'))` is the equivalent of `.limit(1, referencedTable: 'demo_model')`. `Query#limit` can be used in conjunction on the parent model request. +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints - Add `SupabaseProvider#update` and `SupabaseProvider#insert` to conform to Supabase policy restrictions - Use `columnName` instead of `evaluatedField` in `QuerySupabaseTransformer` when searching for non null associations diff --git a/packages/brick_supabase/lib/src/query_supabase_transformer.dart b/packages/brick_supabase/lib/src/query_supabase_transformer.dart index 0c39d348..e8a48e24 100644 --- a/packages/brick_supabase/lib/src/query_supabase_transformer.dart +++ b/packages/brick_supabase/lib/src/query_supabase_transformer.dart @@ -217,7 +217,8 @@ class QuerySupabaseTransformer<_Model extends SupabaseModel> { : withTopLevelLimit; return query!.limitBy.fold(withProviderArgs, (acc, limitBy) { - final tableName = modelDictionary.adapterFor[limitBy.model]?.supabaseTableName; + final definition = adapter.fieldsToSupabaseColumns[limitBy.evaluatedField]; + final tableName = modelDictionary.adapterFor[definition?.associationType]?.supabaseTableName; if (tableName == null) return acc; final url = acc.appendSearchParams('$tableName.limit', limitBy.amount.toString()); @@ -244,13 +245,12 @@ class QuerySupabaseTransformer<_Model extends SupabaseModel> { final withProviderArgs = orderBy == null ? builder : builder.copyWithUrl(url); return query!.orderBy.fold(withProviderArgs, (acc, orderBy) { - final tableName = orderBy.model == null - ? null - : modelDictionary.adapterFor[orderBy.model]?.supabaseTableName; + final definition = adapter.fieldsToSupabaseColumns[orderBy.evaluatedField]; + final tableName = modelDictionary.adapterFor[definition?.associationType]?.supabaseTableName; final url = acc.appendSearchParams( tableName == null ? 'order' : '$tableName.order', - '${orderBy.evaluatedField}.${orderBy.ascending ? 'asc' : 'desc'}.nullslast', + '${orderBy.associationField ?? orderBy.evaluatedField}.${orderBy.ascending ? 'asc' : 'desc'}.nullslast', ); return acc.copyWithUrl(url); }); diff --git a/packages/brick_supabase/pubspec.yaml b/packages/brick_supabase/pubspec.yaml index 0cf40b58..82f06483 100644 --- a/packages/brick_supabase/pubspec.yaml +++ b/packages/brick_supabase/pubspec.yaml @@ -10,12 +10,12 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - brick_core: ">=1.2.1 <2.0.0" + brick_core: ">=1.3.0 <2.0.0" collection: ">=1.15.0 <2.0.0" logging: ">=1.0.0 <2.0.0" meta: ">=1.3.0 <2.0.0" supabase: ">=2.3.0 <3.0.0" dev_dependencies: - lints: ^2.0.1 - test: ^1.16.5 + lints: + test: diff --git a/packages/brick_supabase/test/query_supabase_transformer_test.dart b/packages/brick_supabase/test/query_supabase_transformer_test.dart index 45d129bd..291ca4d5 100644 --- a/packages/brick_supabase/test/query_supabase_transformer_test.dart +++ b/packages/brick_supabase/test/query_supabase_transformer_test.dart @@ -89,7 +89,7 @@ void main() { }); test('by association field', () { - final query = Query.where('assoc', Where.exact('name', 'Thomas')); + final query = Query.where('assoc', const Where.exact('name', 'Thomas')); final select = _buildTransformer(query) .select(_supabaseClient.from(DemoAssociationModelAdapter().supabaseTableName)); @@ -154,35 +154,20 @@ void main() { group('#applyQuery', () { test('orderBy', () { - const query = Query(providerArgs: {'orderBy': 'name asc'}); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); - final transformBuilder = queryTransformer.applyQuery(filterBuilder); + const result = 'select=id,name,custom_age&order=name.asc.nullslast'; - expect( - transformBuilder.query, - 'select=id,name,custom_age&order=name.asc.nullslast', - ); - }); - - test('orderBy with descending order', () { - const query = Query(providerArgs: {'orderBy': 'name desc'}); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); - final transformBuilder = queryTransformer.applyQuery(filterBuilder); + const withProviderArgs = Query(providerArgs: {'orderBy': 'name asc'}); + final providerQueryTransformer = _buildTransformer(withProviderArgs); + final providerFilterBuilder = + providerQueryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + final providerTransformBuilder = providerQueryTransformer.applyQuery(providerFilterBuilder); expect( - transformBuilder.query, - 'select=id,name,custom_age&order=name.desc.nullslast', + providerTransformBuilder.query, + result, ); - }); - test('orderBy with referenced table', () { - const query = Query( - providerArgs: {'orderBy': 'name desc', 'orderByReferencedTable': 'foreign_tables'}, - ); + const query = Query(orderBy: [OrderBy('name')]); final queryTransformer = _buildTransformer(query); final filterBuilder = queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); @@ -190,32 +175,25 @@ void main() { expect( transformBuilder.query, - 'select=id,name,custom_age&foreign_tables.order=name.desc.nullslast', + result, ); }); - test('limit', () { - const query = Query(providerArgs: {'limit': 10}); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); - final transformBuilder = queryTransformer.applyQuery(filterBuilder); - - expect(transformBuilder.query, 'select=id,name,custom_age&limit=10'); - }); + test('orderBy with descending order', () { + const result = 'select=id,name,custom_age&order=age.desc.nullslast'; - test('limit with referenced table', () { - const query = Query(providerArgs: {'limit': 10, 'limitReferencedTable': 'foreign_tables'}); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); - final transformBuilder = queryTransformer.applyQuery(filterBuilder); + const query0 = Query(providerArgs: {'orderBy': 'age desc'}); + final queryTransformer0 = _buildTransformer(query0); + final filterBuilder0 = + queryTransformer0.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + final transformBuilder0 = queryTransformer0.applyQuery(filterBuilder0); - expect(transformBuilder.query, 'select=id,name,custom_age&foreign_tables.limit=10'); - }); + expect( + transformBuilder0.query, + result, + ); - test('combined orderBy and limit', () { - const query = Query(providerArgs: {'orderBy': 'name desc', 'limit': 20}); + const query = Query(orderBy: [OrderBy('age', ascending: false)]); final queryTransformer = _buildTransformer(query); final filterBuilder = queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); @@ -223,74 +201,112 @@ void main() { expect( transformBuilder.query, - 'select=id,name,custom_age&order=name.desc.nullslast&limit=20', + result, ); }); - }); - group('#query', () { - test('orderBy', () { - const query = Query(orderBy: [OrderBy('name')]); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); - final transformBuilder = queryTransformer.applyQuery(filterBuilder); + test('orderBy with referenced table', () { + const result = + 'select=id,nested_column:demo_associations(id,name,assoc_id:demos!assoc_id(id,name,custom_age),assocs:demos(id,name,custom_age))&demo_associations.order=name.desc.nullslast'; + const query0 = Query( + providerArgs: {'orderBy': 'name desc', 'orderByReferencedTable': 'demo_associations'}, + ); + final queryTransformer0 = _buildTransformer(query0); + final filterBuilder0 = queryTransformer0 + .select(_supabaseClient.from(DemoNestedAssociationModelAdapter().supabaseTableName)); + final transformBuilder0 = queryTransformer0.applyQuery(filterBuilder0); expect( - transformBuilder.query, - 'select=id,name,custom_age&order=name.asc.nullslast', + transformBuilder0.query, + result, ); - }); - test('orderBy with descending order', () { - const query = Query(orderBy: [OrderBy('name', ascending: false)]); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + const query = Query( + orderBy: [OrderBy.desc('nested', associationField: 'name')], + ); + final queryTransformer = _buildTransformer(query); + final filterBuilder = queryTransformer + .select(_supabaseClient.from(DemoNestedAssociationModelAdapter().supabaseTableName)); final transformBuilder = queryTransformer.applyQuery(filterBuilder); expect( transformBuilder.query, - 'select=id,name,custom_age&order=name.desc.nullslast', + result, ); }); - test('orderBy with referenced table', () { - final query = Query( - orderBy: [OrderBy.desc('name', model: DemoAssociationModel)], + test('orderBy with referenced table, no association field', () { + const query = Query( + orderBy: [OrderBy.desc('nested')], ); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + final queryTransformer = _buildTransformer(query); + final filterBuilder = queryTransformer + .select(_supabaseClient.from(DemoNestedAssociationModelAdapter().supabaseTableName)); final transformBuilder = queryTransformer.applyQuery(filterBuilder); expect( transformBuilder.query, - 'select=id,name,custom_age&demo_associations.order=name.desc.nullslast', + 'select=id,nested_column:demo_associations(id,name,assoc_id:demos!assoc_id(id,name,custom_age),assocs:demos(id,name,custom_age))&demo_associations.order=nested.desc.nullslast', ); }); test('limit', () { + const result = 'select=id,name,custom_age&limit=10'; + const query0 = Query(providerArgs: {'limit': 10}); + final queryTransformer0 = _buildTransformer(query0); + final filterBuilder0 = + queryTransformer0.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + final transformBuilder0 = queryTransformer0.applyQuery(filterBuilder0); + + expect(transformBuilder0.query, result); + const query = Query(limit: 10); final queryTransformer = _buildTransformer(query); final filterBuilder = queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); final transformBuilder = queryTransformer.applyQuery(filterBuilder); - expect(transformBuilder.query, 'select=id,name,custom_age&limit=10'); + expect(transformBuilder.query, result); }); test('limit with referenced table', () { - const query = Query(limitBy: [LimitBy(10, model: DemoAssociationModel)]); - final queryTransformer = _buildTransformer(query); - final filterBuilder = - queryTransformer.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + const result = + 'select=id,nested_column:demo_associations(id,name,assoc_id:demos!assoc_id(id,name,custom_age),assocs:demos(id,name,custom_age))&demo_associations.limit=10'; + const query0 = + Query(providerArgs: {'limit': 10, 'limitReferencedTable': 'demo_associations'}); + final queryTransformer0 = _buildTransformer(query0); + final filterBuilder0 = queryTransformer0 + .select(_supabaseClient.from(DemoNestedAssociationModelAdapter().supabaseTableName)); + final transformBuilder0 = queryTransformer0.applyQuery(filterBuilder0); + + expect(transformBuilder0.query, result); + + const query = Query(limitBy: [LimitBy(10, evaluatedField: 'nested')]); + final queryTransformer = _buildTransformer(query); + final filterBuilder = queryTransformer + .select(_supabaseClient.from(DemoNestedAssociationModelAdapter().supabaseTableName)); final transformBuilder = queryTransformer.applyQuery(filterBuilder); - expect(transformBuilder.query, 'select=id,name,custom_age&demo_associations.limit=10'); + expect( + transformBuilder.query, + result, + ); }); test('combined orderBy and limit', () { + const result = 'select=id,name,custom_age&order=name.desc.nullslast&limit=20'; + + const query0 = Query(providerArgs: {'orderBy': 'name desc', 'limit': 20}); + final queryTransformer0 = _buildTransformer(query0); + final filterBuilder0 = + queryTransformer0.select(_supabaseClient.from(DemoAdapter().supabaseTableName)); + final transformBuilder0 = queryTransformer0.applyQuery(filterBuilder0); + + expect( + transformBuilder0.query, + result, + ); + const query = Query(limit: 20, orderBy: [OrderBy('name', ascending: false)]); final queryTransformer = _buildTransformer(query); final filterBuilder = @@ -299,7 +315,7 @@ void main() { expect( transformBuilder.query, - 'select=id,name,custom_age&order=name.desc.nullslast&limit=20', + result, ); }); }); @@ -346,14 +362,14 @@ void main() { test('missing field', () { final transformer = _buildTransformer(); - expect(transformer.expandCondition(Where.exact('made_up_field', 1)), isEmpty); + expect(transformer.expandCondition(const Where.exact('made_up_field', 1)), isEmpty); }); test('matching a value to an association', () { final transformer = _buildTransformer(); expect( - () => transformer.expandCondition(Where.exact('assoc', 1)), + () => transformer.expandCondition(const Where.exact('assoc', 1)), throwsA(const TypeMatcher()), ); }); @@ -362,7 +378,7 @@ void main() { final transformer = _buildTransformer(); final result = transformer.expandCondition( WherePhrase([ - Where.exact('id', 1), + const Where.exact('id', 1), const Or('name').isExactly('Guy'), ]), ); diff --git a/packages/brick_supabase_generators/CHANGELOG.md b/packages/brick_supabase_generators/CHANGELOG.md index a8152242..702bb0ad 100644 --- a/packages/brick_supabase_generators/CHANGELOG.md +++ b/packages/brick_supabase_generators/CHANGELOG.md @@ -1,5 +1,10 @@ ## Unreleased +## 1.1.0 + +- Upgrade `brick_core` to `1.3.0` +- Update analysis to modern lints + ## 1.0.2 - Interpret `@Supabase(query:)` in `SupabaseFields` diff --git a/packages/brick_supabase_generators/pubspec.yaml b/packages/brick_supabase_generators/pubspec.yaml index 45c40d79..9a899d51 100644 --- a/packages/brick_supabase_generators/pubspec.yaml +++ b/packages/brick_supabase_generators/pubspec.yaml @@ -4,7 +4,7 @@ homepage: https://github.com/GetDutchie/brick/tree/main/packages/brick_supabase_ issue_tracker: https://github.com/GetDutchie/brick/issues repository: https://github.com/GetDutchie/brick -version: 1.0.2 +version: 1.1.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -12,7 +12,7 @@ environment: dependencies: analyzer: ">=6.0.0 <7.0.0" brick_build: ">=3.2.0 <4.0.0" - brick_core: ">=1.2.1 <2.0.0" + brick_core: ">=1.3.0 <2.0.0" brick_json_generators: ">=3.1.0 <4.0.0" brick_supabase: ">=1.1.3 <2.0.0" build: ">=2.0.0 <3.0.0"