diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adb0541b..fb1c03a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 10 container: - image: dart:3.2.6 + image: dart:3.3.0 steps: - name: Check out code @@ -35,7 +35,7 @@ jobs: timeout-minutes: 10 container: - image: dart:3.2.6 + image: dart:3.3.0 steps: - name: Check out code diff --git a/floor/lib/src/sqflite_database_factory.dart b/floor/lib/src/sqflite_database_factory.dart index dc6f1bdf..89a48bd7 100644 --- a/floor/lib/src/sqflite_database_factory.dart +++ b/floor/lib/src/sqflite_database_factory.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:path/path.dart'; +// ignore: unnecessary_import import 'package:sqflite/sqflite.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; diff --git a/floor/pubspec.lock b/floor/pubspec.lock index c4856827..e7b7661a 100644 --- a/floor/pubspec.lock +++ b/floor/pubspec.lock @@ -301,26 +301,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: cdd14e3836065a1f6302a236ec8b5f700695c803c57ae11a1c84df31e6bcf831 url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.3" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "9b2ef90589911d665277464e0482b209d39882dffaaf4ef69a3561a3354b2ebc" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.2" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: fd3cd66cb2bcd7b50dcd3b413af49d78051f809c8b3f6e047962765c15a0d23d url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" lists: dependency: transitive description: @@ -490,10 +490,10 @@ packages: dependency: "direct main" description: name: sqlparser - sha256: dc384bb1f56d1384ce078edb5ff8247976abdab79d0c83e437210c85f06ecb61 + sha256: "7b20045d1ccfb7bc1df7e8f9fee5ae58673fce6ff62cefbb0e0fd7214e90e5a0" url: "https://pub.dev" source: hosted - version: "0.34.0" + version: "0.34.1" stack_trace: dependency: transitive description: @@ -530,10 +530,10 @@ packages: dependency: transitive description: name: strings - sha256: "1f3db7347b8dfd9844ee7fb34883cffbe6cc723a63cb9f4a0aa19e619304b030" + sha256: b33f40c4dd3e597bf6d9e7f4f4dc282dad0f19b07d9f320cb5c2183859cbccf5 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.1" synchronized: dependency: transitive description: @@ -554,10 +554,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" timing: dependency: transitive description: @@ -594,10 +594,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246 url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.0.0" watcher: dependency: transitive description: @@ -624,4 +624,4 @@ packages: version: "3.1.1" sdks: dart: ">=3.2.6 <4.0.0" - flutter: ">=3.7.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/floor/pubspec.yaml b/floor/pubspec.yaml index c39ad2cc..f1a22f66 100644 --- a/floor/pubspec.yaml +++ b/floor/pubspec.yaml @@ -31,4 +31,4 @@ dev_dependencies: sdk: flutter matcher: ^0.12.16+1 mockito: ^5.4.4 - sqflite_common: ^2.5.3 + sqflite_common: ^2.5.3 \ No newline at end of file diff --git a/floor_annotation/lib/src/entity.dart b/floor_annotation/lib/src/entity.dart index 5573715b..843ab1be 100644 --- a/floor_annotation/lib/src/entity.dart +++ b/floor_annotation/lib/src/entity.dart @@ -7,16 +7,16 @@ class Entity { final String? tableName; /// List of indices on the table. - final List indices; + final List? indices; /// List of [ForeignKey] constraints on this entity. - final List foreignKeys; + final List? foreignKeys; /// List of primary key column names. - final List primaryKeys; + final List? primaryKeys; /// Whether the table is a "WITHOUT ROWID table". - final bool withoutRowid; + final bool? withoutRowid; /// Marks a class as a database entity (table). const Entity({ diff --git a/floor_generator/pubspec.lock b/floor_generator/pubspec.lock index e579b234..11d7e444 100644 --- a/floor_generator/pubspec.lock +++ b/floor_generator/pubspec.lock @@ -157,10 +157,10 @@ packages: dependency: "direct dev" description: name: dart_style - sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + sha256: "25b4624c231844a7a70a3817a729a6190a751ef1c07ded256e126a3b72261444" url: "https://pub.dev" source: hosted - version: "2.3.4" + version: "2.3.5" file: dependency: transitive description: @@ -452,10 +452,10 @@ packages: dependency: "direct main" description: name: strings - sha256: "1f3db7347b8dfd9844ee7fb34883cffbe6cc723a63cb9f4a0aa19e619304b030" + sha256: b33f40c4dd3e597bf6d9e7f4f4dc282dad0f19b07d9f320cb5c2183859cbccf5 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.1" term_glyph: dependency: transitive description: diff --git a/floor_generator/pubspec.yaml b/floor_generator/pubspec.yaml index 3fb9ebe2..ba572593 100644 --- a/floor_generator/pubspec.yaml +++ b/floor_generator/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: path: ../floor_annotation meta: source_gen: ^1.5.0 - strings: ^3.0.0 + strings: ^3.1.1 dev_dependencies: build_test: ^2.2.2 diff --git a/floor_generator/test/misc/extension/type_converter_element_extension_test.dart b/floor_generator/test/misc/extension/type_converter_element_extension_test.dart index 98d0de85..b21a3b31 100644 --- a/floor_generator/test/misc/extension/type_converter_element_extension_test.dart +++ b/floor_generator/test/misc/extension/type_converter_element_extension_test.dart @@ -47,7 +47,7 @@ void main() { final actual = () => element.getTypeConverters(typeConverterScope); - expect(actual, throwsProcessorError()); + expect(actual, throwsUnresolvedAnnotationException()); }); test('throws error when empty list in annotation', () async { diff --git a/floor_generator/test/processor/entity_processor_test.dart b/floor_generator/test/processor/entity_processor_test.dart index 166955a6..02332bbb 100644 --- a/floor_generator/test/processor/entity_processor_test.dart +++ b/floor_generator/test/processor/entity_processor_test.dart @@ -1,7 +1,6 @@ import 'package:analyzer/dart/element/element.dart'; import 'package:build_test/build_test.dart'; import 'package:floor_annotation/floor_annotation.dart' as annotations; -import 'package:floor_generator/misc/constants.dart'; import 'package:floor_generator/processor/entity_processor.dart'; import 'package:floor_generator/processor/error/entity_processor_error.dart'; import 'package:floor_generator/processor/error/queryable_processor_error.dart'; @@ -14,7 +13,6 @@ import 'package:floor_generator/value_object/primary_key.dart'; import 'package:source_gen/source_gen.dart'; import 'package:test/test.dart'; -import '../fakes.dart'; import '../test_utils.dart'; void main() { @@ -68,7 +66,7 @@ void main() { primaryKeys:null, withoutRowid:null, ) - @Fts3(tokenizerArgs:null) + @Fts3() class Person { @primaryKey final int id; @@ -279,50 +277,6 @@ void main() { ); expect(actual, equals(expected)); }); - - test('error with wrong onUpdate Annotation', () async { - final classElements = await _createClassElements(''' - @entity - class Person { - @primaryKey - final int id; - - final String name; - - Person(this.id, this.name); - } - - @Entity( - foreignKeys: [ - ForeignKey( - childColumns: ['owner_id'], - parentColumns: ['id'], - entity: Person, - onUpdate: null - onDelete: ForeignKeyAction.setNull, - ) - ], - ) - class Dog { - @primaryKey - final int id; - - final String name; - - @ColumnInfo(name: 'owner_id') - final int ownerId; - - Dog(this.id, this.name, this.ownerId); - } - '''); - - final processor = EntityProcessor(classElements[1], {}); - expect( - processor.process, - throwsInvalidGenerationSourceError( - EntityProcessorError(classElements[1]).wrongForeignKeyAction( - FakeDartObject(), ForeignKeyField.onUpdate))); - }); }); group('fts keys', () { @@ -566,7 +520,6 @@ void main() { childColumns: ['owner_id'], parentColumns: [], entity: Person, - onUpdate: null onDelete: ForeignKeyAction.setNull, ) ], @@ -608,7 +561,6 @@ void main() { childColumns: [], parentColumns: ['id'], entity: Person, - onUpdate: null onDelete: ForeignKeyAction.setNull, ) ], @@ -675,7 +627,6 @@ void main() { childColumns: ['owner_id'], parentColumns: ['id'], entity: Person, - onUpdate: null onDelete: ForeignKeyAction.setNull, ) ], diff --git a/floor_generator/test/test_utils.dart b/floor_generator/test/test_utils.dart index 5858f00d..0a5960ae 100644 --- a/floor_generator/test/test_utils.dart +++ b/floor_generator/test/test_utils.dart @@ -157,6 +157,10 @@ Matcher throwsProcessorError([ } } +Matcher throwsUnresolvedAnnotationException() { + return throwsA(isA()); +} + Future createDao(final String methodSignature) async { final library = await resolveSource(''' library test;