From 26333eafb519cadf729c1656f6c149cfaf722648 Mon Sep 17 00:00:00 2001 From: westito Date: Mon, 1 Aug 2022 12:15:42 +0200 Subject: [PATCH 1/3] Fix lint warnings when strict type check enabled --- drift_dev/lib/src/writer/database_writer.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drift_dev/lib/src/writer/database_writer.dart b/drift_dev/lib/src/writer/database_writer.dart index 9525f240..9571386e 100644 --- a/drift_dev/lib/src/writer/database_writer.dart +++ b/drift_dev/lib/src/writer/database_writer.dart @@ -117,8 +117,9 @@ class DatabaseWriter { // Write List of tables final schemaScope = dbScope.leaf(); schemaScope - ..write('@override\nIterable get allTables => ') - ..write('allSchemaEntities.whereType();\n') + ..write( + '@override\nIterable> get allTables => ') + ..write('allSchemaEntities.whereType<>();\n') ..write('@override\nList get allSchemaEntities ') ..write('=> ['); From 5c05b4e3750a5d3683bd1bbc423d1af889ea5cc8 Mon Sep 17 00:00:00 2001 From: westito Date: Mon, 8 Aug 2022 11:27:03 +0200 Subject: [PATCH 2/3] Update drift_dev/lib/src/writer/database_writer.dart Co-authored-by: Simon Binder --- drift_dev/lib/src/writer/database_writer.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drift_dev/lib/src/writer/database_writer.dart b/drift_dev/lib/src/writer/database_writer.dart index 9571386e..c1a745ec 100644 --- a/drift_dev/lib/src/writer/database_writer.dart +++ b/drift_dev/lib/src/writer/database_writer.dart @@ -119,7 +119,7 @@ class DatabaseWriter { schemaScope ..write( '@override\nIterable> get allTables => ') - ..write('allSchemaEntities.whereType<>();\n') + ..write('allSchemaEntities.whereType>();\n') ..write('@override\nList get allSchemaEntities ') ..write('=> ['); From e65c4d15d04a90e57d479b46c3634843f29d9bc2 Mon Sep 17 00:00:00 2001 From: westito Date: Mon, 8 Aug 2022 11:30:47 +0200 Subject: [PATCH 3/3] Regenerate database files --- drift/example/main.g.dart | 3 ++- drift/test/generated/custom_tables.g.dart | 3 ++- drift/test/generated/todos.g.dart | 3 ++- examples/app/lib/database/database.g.dart | 3 ++- .../lib/src/database/database.g.dart | 3 ++- examples/migrations_example/lib/database.g.dart | 3 ++- examples/web_worker_example/lib/database.g.dart | 3 ++- examples/with_built_value/lib/database.drift.dart | 3 ++- extras/benchmarks/lib/src/moor/database.g.dart | 3 ++- .../drift_testcases/lib/database/database.g.dart | 3 ++- .../web/test/saves_after_migration_regression_test.g.dart | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drift/example/main.g.dart b/drift/example/main.g.dart index dd554030..09d983b1 100644 --- a/drift/example/main.g.dart +++ b/drift/example/main.g.dart @@ -686,7 +686,8 @@ abstract class _$Database extends GeneratedDatabase { late final $TodoItemWithCategoryNameViewView customViewName = $TodoItemWithCategoryNameViewView(this); @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [todoCategories, todoItems, todoCategoryItemCount, customViewName]; diff --git a/drift/test/generated/custom_tables.g.dart b/drift/test/generated/custom_tables.g.dart index ba28c77b..1d7ed8f0 100644 --- a/drift/test/generated/custom_tables.g.dart +++ b/drift/test/generated/custom_tables.g.dart @@ -1826,7 +1826,8 @@ abstract class _$CustomTablesDb extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ config, diff --git a/drift/test/generated/todos.g.dart b/drift/test/generated/todos.g.dart index a152d85b..08b5184e 100644 --- a/drift/test/generated/todos.g.dart +++ b/drift/test/generated/todos.g.dart @@ -1667,7 +1667,8 @@ abstract class _$TodoDb extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [ categories, diff --git a/examples/app/lib/database/database.g.dart b/examples/app/lib/database/database.g.dart index da166563..f9281e7b 100644 --- a/examples/app/lib/database/database.g.dart +++ b/examples/app/lib/database/database.g.dart @@ -660,7 +660,8 @@ abstract class _$AppDatabase extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [categories, todoEntries, textEntries, todosInsert]; diff --git a/examples/flutter_web_worker_example/lib/src/database/database.g.dart b/examples/flutter_web_worker_example/lib/src/database/database.g.dart index c275080a..f77b50d8 100644 --- a/examples/flutter_web_worker_example/lib/src/database/database.g.dart +++ b/examples/flutter_web_worker_example/lib/src/database/database.g.dart @@ -203,7 +203,8 @@ abstract class _$MyDatabase extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [entries]; } diff --git a/examples/migrations_example/lib/database.g.dart b/examples/migrations_example/lib/database.g.dart index ae50b4e1..a5897851 100644 --- a/examples/migrations_example/lib/database.g.dart +++ b/examples/migrations_example/lib/database.g.dart @@ -638,7 +638,8 @@ abstract class _$Database extends GeneratedDatabase { late final Groups groups = Groups(this); late final GroupCount groupCount = GroupCount(this); @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [users, groups, groupCount]; diff --git a/examples/web_worker_example/lib/database.g.dart b/examples/web_worker_example/lib/database.g.dart index 72c57c58..48afe32d 100644 --- a/examples/web_worker_example/lib/database.g.dart +++ b/examples/web_worker_example/lib/database.g.dart @@ -204,7 +204,8 @@ abstract class _$MyDatabase extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [entries]; } diff --git a/examples/with_built_value/lib/database.drift.dart b/examples/with_built_value/lib/database.drift.dart index 89724705..ee0843a0 100644 --- a/examples/with_built_value/lib/database.drift.dart +++ b/examples/with_built_value/lib/database.drift.dart @@ -180,7 +180,8 @@ abstract class _$Database extends GeneratedDatabase { _$Database(QueryExecutor e) : super(e); late final Users users = Users(this); @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [users]; } diff --git a/extras/benchmarks/lib/src/moor/database.g.dart b/extras/benchmarks/lib/src/moor/database.g.dart index a85e5ae0..2788c144 100644 --- a/extras/benchmarks/lib/src/moor/database.g.dart +++ b/extras/benchmarks/lib/src/moor/database.g.dart @@ -180,7 +180,8 @@ abstract class _$Database extends GeneratedDatabase { _$Database(QueryExecutor e) : super(e); late final $KeyValuesTable keyValues = $KeyValuesTable(this); @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [keyValues]; } diff --git a/extras/integration_tests/drift_testcases/lib/database/database.g.dart b/extras/integration_tests/drift_testcases/lib/database/database.g.dart index 0df5ccbf..1572397c 100644 --- a/extras/integration_tests/drift_testcases/lib/database/database.g.dart +++ b/extras/integration_tests/drift_testcases/lib/database/database.g.dart @@ -635,7 +635,8 @@ abstract class _$Database extends GeneratedDatabase { } @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [users, friendships]; } diff --git a/extras/integration_tests/web/test/saves_after_migration_regression_test.g.dart b/extras/integration_tests/web/test/saves_after_migration_regression_test.g.dart index 16b25252..eae7a020 100644 --- a/extras/integration_tests/web/test/saves_after_migration_regression_test.g.dart +++ b/extras/integration_tests/web/test/saves_after_migration_regression_test.g.dart @@ -282,7 +282,8 @@ abstract class _$_FakeDb extends GeneratedDatabase { late final $FoosTable foos = $FoosTable(this); late final $BarsTable bars = $BarsTable(this); @override - Iterable get allTables => allSchemaEntities.whereType(); + Iterable> get allTables => + allSchemaEntities.whereType>(); @override List get allSchemaEntities => [foos, bars]; }