From 71adda9fae759790479a6227213d7104d91344da Mon Sep 17 00:00:00 2001 From: Ramon Rivas Date: Mon, 7 Feb 2022 01:57:46 -0500 Subject: [PATCH 01/22] split floor into floor_common, floor, floor_ffi to be able to use floor without flutter. --- example/pubspec.lock | 7 + floor/lib/floor.dart | 12 +- floor/lib/src/sqflite_database_factory.dart | 8 - floor/pubspec.lock | 12 +- floor/pubspec.yaml | 12 +- floor_common/LICENSE | 174 ++++++ floor_common/README.md | 30 + floor_common/lib/floor_common.dart | 12 + .../lib/src/adapter/deletion_adapter.dart | 4 +- .../lib/src/adapter/insertion_adapter.dart | 4 +- .../lib/src/adapter/migration_adapter.dart | 4 +- .../lib/src/adapter/query_adapter.dart | 2 +- .../lib/src/adapter/update_adapter.dart | 6 +- {floor => floor_common}/lib/src/callback.dart | 2 +- {floor => floor_common}/lib/src/database.dart | 2 +- .../lib/src/database_factory_ext.dart | 9 + .../on_conflict_strategy_extensions.dart | 2 +- .../lib/src/migration.dart | 2 +- .../lib/src/util/primary_key_helper.dart | 0 floor_common/pubspec.lock | 544 ++++++++++++++++++ floor_common/pubspec.yaml | 27 + .../test/adapter/deletion_adapter_test.dart | 4 +- .../test/adapter/insertion_adapter_test.dart | 6 +- .../test/adapter/migration_adapter_test.dart | 6 +- .../test/adapter/query_adapter_test.dart | 4 +- .../test/adapter/update_adapter_test.dart | 6 +- .../on_conflict_strategy_extensions_test.dart | 8 +- .../autoincrement/autoinc_test.dart | 8 +- .../test/integration/blob/blob_test.dart | 8 +- .../boolean_conversions/bool_test.dart | 8 +- .../test/integration/dao/dog_dao.dart | 2 +- .../test/integration/dao/name_dao.dart | 2 +- .../test/integration/dao/person_dao.dart | 2 +- .../test/integration/database.dart | 5 +- .../test/integration/database_test.dart | 6 +- .../test/integration/fts/mail.dart | 2 +- .../test/integration/fts/mail_dao.dart | 2 +- .../test/integration/fts/mail_database.dart | 5 +- .../integration/fts/mail_database_test.dart | 2 +- .../inheritance/dao_inheritance_test.dart | 8 +- .../inheritance/entity_inheritance_test.dart | 8 +- .../test/integration/model/dog.dart | 2 +- .../integration/model/mutliline_name.dart | 2 +- .../test/integration/model/name.dart | 2 +- .../test/integration/model/person.dart | 2 +- .../test/integration/stream_query_test.dart | 2 +- .../integration/type_converter/order.dart | 2 +- .../integration/type_converter/order_dao.dart | 2 +- .../type_converter/order_database.dart | 5 +- .../type_converter/type_converter.dart | 2 +- .../type_converter_database_test.dart | 2 +- .../type_converter/type_converter_test.dart | 2 +- .../test/integration/view/view_test.dart | 7 +- .../test/test_util/database_factory.dart | 8 + .../test/test_util/extensions.dart | 0 .../test/test_util/mocks.dart | 0 .../test/test_util/person.dart | 0 .../test/util/primary_key_helper_test.dart | 4 +- floor_ffi/.metadata | 10 + floor_ffi/CHANGELOG.md | 344 +++++++++++ floor_ffi/LICENSE | 174 ++++++ floor_ffi/lib/floor_ffi.dart | 2 + .../lib/src/sqflite_database_factory.dart | 8 + floor_ffi/pubspec.lock | 75 +++ floor_ffi/pubspec.yaml | 19 + 65 files changed, 1543 insertions(+), 110 deletions(-) create mode 100644 floor_common/LICENSE create mode 100644 floor_common/README.md create mode 100644 floor_common/lib/floor_common.dart rename {floor => floor_common}/lib/src/adapter/deletion_adapter.dart (95%) rename {floor => floor_common}/lib/src/adapter/insertion_adapter.dart (94%) rename {floor => floor_common}/lib/src/adapter/migration_adapter.dart (90%) rename {floor => floor_common}/lib/src/adapter/query_adapter.dart (98%) rename {floor => floor_common}/lib/src/adapter/update_adapter.dart (93%) rename {floor => floor_common}/lib/src/callback.dart (95%) rename {floor => floor_common}/lib/src/database.dart (92%) create mode 100644 floor_common/lib/src/database_factory_ext.dart rename {floor => floor_common}/lib/src/extension/on_conflict_strategy_extensions.dart (92%) rename {floor => floor_common}/lib/src/migration.dart (95%) rename {floor => floor_common}/lib/src/util/primary_key_helper.dart (100%) create mode 100644 floor_common/pubspec.lock create mode 100644 floor_common/pubspec.yaml rename {floor => floor_common}/test/adapter/deletion_adapter_test.dart (97%) rename {floor => floor_common}/test/adapter/insertion_adapter_test.dart (98%) rename {floor => floor_common}/test/adapter/migration_adapter_test.dart (94%) rename {floor => floor_common}/test/adapter/query_adapter_test.dart (98%) rename {floor => floor_common}/test/adapter/update_adapter_test.dart (97%) rename {floor => floor_common}/test/extension/on_conflict_strategy_extensions_test.dart (84%) rename {floor => floor_common}/test/integration/autoincrement/autoinc_test.dart (90%) rename {floor => floor_common}/test/integration/blob/blob_test.dart (89%) rename {floor => floor_common}/test/integration/boolean_conversions/bool_test.dart (93%) rename {floor => floor_common}/test/integration/dao/dog_dao.dart (84%) rename {floor => floor_common}/test/integration/dao/name_dao.dart (94%) rename {floor => floor_common}/test/integration/dao/person_dao.dart (98%) rename {floor => floor_common}/test/integration/database.dart (66%) rename {floor => floor_common}/test/integration/database_test.dart (99%) rename {floor => floor_common}/test/integration/fts/mail.dart (92%) rename {floor => floor_common}/test/integration/fts/mail_dao.dart (93%) rename {floor => floor_common}/test/integration/fts/mail_database.dart (57%) rename {floor => floor_common}/test/integration/fts/mail_database_test.dart (98%) rename {floor => floor_common}/test/integration/inheritance/dao_inheritance_test.dart (88%) rename {floor => floor_common}/test/integration/inheritance/entity_inheritance_test.dart (92%) rename {floor => floor_common}/test/integration/model/dog.dart (95%) rename {floor => floor_common}/test/integration/model/mutliline_name.dart (91%) rename {floor => floor_common}/test/integration/model/name.dart (90%) rename {floor => floor_common}/test/integration/model/person.dart (92%) rename {floor => floor_common}/test/integration/stream_query_test.dart (99%) rename {floor => floor_common}/test/integration/type_converter/order.dart (90%) rename {floor => floor_common}/test/integration/type_converter/order_dao.dart (87%) rename {floor => floor_common}/test/integration/type_converter/order_database.dart (64%) rename {floor => floor_common}/test/integration/type_converter/type_converter.dart (84%) rename {floor => floor_common}/test/integration/type_converter/type_converter_database_test.dart (95%) rename {floor => floor_common}/test/integration/type_converter/type_converter_test.dart (92%) rename {floor => floor_common}/test/integration/view/view_test.dart (95%) create mode 100644 floor_common/test/test_util/database_factory.dart rename {floor => floor_common}/test/test_util/extensions.dart (100%) rename {floor => floor_common}/test/test_util/mocks.dart (100%) rename {floor => floor_common}/test/test_util/person.dart (100%) rename {floor => floor_common}/test/util/primary_key_helper_test.dart (94%) create mode 100644 floor_ffi/.metadata create mode 100644 floor_ffi/CHANGELOG.md create mode 100644 floor_ffi/LICENSE create mode 100644 floor_ffi/lib/floor_ffi.dart create mode 100644 floor_ffi/lib/src/sqflite_database_factory.dart create mode 100644 floor_ffi/pubspec.lock create mode 100644 floor_ffi/pubspec.yaml diff --git a/example/pubspec.lock b/example/pubspec.lock index e66316ba..5654693d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -204,6 +204,13 @@ packages: relative: true source: path version: "1.0.1" + floor_common: + dependency: transitive + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" floor_generator: dependency: "direct dev" description: diff --git a/floor/lib/floor.dart b/floor/lib/floor.dart index f60f694f..5793c19a 100644 --- a/floor/lib/floor.dart +++ b/floor/lib/floor.dart @@ -1,12 +1,2 @@ -library floor; - -export 'package:floor/src/adapter/deletion_adapter.dart'; -export 'package:floor/src/adapter/insertion_adapter.dart'; -export 'package:floor/src/adapter/migration_adapter.dart'; -export 'package:floor/src/adapter/query_adapter.dart'; -export 'package:floor/src/adapter/update_adapter.dart'; -export 'package:floor/src/callback.dart'; -export 'package:floor/src/database.dart'; -export 'package:floor/src/migration.dart'; export 'package:floor/src/sqflite_database_factory.dart'; -export 'package:floor_annotation/floor_annotation.dart'; +export 'package:floor_common/floor_common.dart'; diff --git a/floor/lib/src/sqflite_database_factory.dart b/floor/lib/src/sqflite_database_factory.dart index dc6f1bdf..ba617c2b 100644 --- a/floor/lib/src/sqflite_database_factory.dart +++ b/floor/lib/src/sqflite_database_factory.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:path/path.dart'; import 'package:sqflite/sqflite.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; @@ -17,10 +16,3 @@ final DatabaseFactory sqfliteDatabaseFactory = () { ); } }(); - -extension DatabaseFactoryExtension on DatabaseFactory { - Future getDatabasePath(final String name) async { - final databasesPath = await this.getDatabasesPath(); - return join(databasesPath, name); - } -} diff --git a/floor/pubspec.lock b/floor/pubspec.lock index a0716444..49770b02 100644 --- a/floor/pubspec.lock +++ b/floor/pubspec.lock @@ -197,6 +197,13 @@ packages: relative: true source: path version: "1.0.1" + floor_common: + dependency: "direct main" + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" floor_generator: dependency: "direct dev" description: @@ -209,11 +216,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" frontend_server_client: dependency: transitive description: diff --git a/floor/pubspec.yaml b/floor/pubspec.yaml index 39f06a40..309f2b99 100644 --- a/floor/pubspec.yaml +++ b/floor/pubspec.yaml @@ -12,19 +12,11 @@ environment: dependencies: floor_annotation: path: ../floor_annotation/ + floor_common: + path: ../floor_common/ flutter: sdk: flutter meta: ^1.7.0 path: ^1.8.0 sqflite: ^2.0.0+4 sqflite_common_ffi: ^2.0.0+3 - -dev_dependencies: - build_runner: ^2.1.2 - collection: ^1.15.0 - floor_generator: - path: ../floor_generator/ - flutter_test: - sdk: flutter - matcher: ^0.12.10 - mockito: ^5.0.15 diff --git a/floor_common/LICENSE b/floor_common/LICENSE new file mode 100644 index 00000000..dd5b3a58 --- /dev/null +++ b/floor_common/LICENSE @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/floor_common/README.md b/floor_common/README.md new file mode 100644 index 00000000..0f6fc42c --- /dev/null +++ b/floor_common/README.md @@ -0,0 +1,30 @@ +# Floor +**The typesafe, reactive and lightweight SQLite abstraction for your Flutter applications (iOS, Android, Linux, macOS, Windows)** + +Don't import this package! +You should be using the [floor](https://pub.dartlang.org/packages/floor) package, which comes with all the annotations. +Separating the packages brings some benefits for developing the library but not for the users of it. + +--- + +The library's name derives from the following. +*Floor* as the *bottom layer* of a [Room](https://developer.android.com/topic/libraries/architecture/room) which points to the analogy of the database layer being the bottom and foundation layer of most applications. +Where *fl* also gives a pointer that the library is used in the Flutter context. + +## Bugs and Feedback +For bugs, questions and discussions please use [Github Issues](https://github.com/vitusortner/floor/issues). + +## License + Copyright 2021 The Floor Project Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/floor_common/lib/floor_common.dart b/floor_common/lib/floor_common.dart new file mode 100644 index 00000000..762ec968 --- /dev/null +++ b/floor_common/lib/floor_common.dart @@ -0,0 +1,12 @@ +library floor; + +export 'package:floor_annotation/floor_annotation.dart'; +export 'package:floor_common/src/adapter/deletion_adapter.dart'; +export 'package:floor_common/src/adapter/insertion_adapter.dart'; +export 'package:floor_common/src/adapter/migration_adapter.dart'; +export 'package:floor_common/src/adapter/query_adapter.dart'; +export 'package:floor_common/src/adapter/update_adapter.dart'; +export 'package:floor_common/src/callback.dart'; +export 'package:floor_common/src/database.dart'; +export 'package:floor_common/src/database_factory_ext.dart'; +export 'package:floor_common/src/migration.dart'; diff --git a/floor/lib/src/adapter/deletion_adapter.dart b/floor_common/lib/src/adapter/deletion_adapter.dart similarity index 95% rename from floor/lib/src/adapter/deletion_adapter.dart rename to floor_common/lib/src/adapter/deletion_adapter.dart index 1396fcaf..9a5b1721 100644 --- a/floor/lib/src/adapter/deletion_adapter.dart +++ b/floor_common/lib/src/adapter/deletion_adapter.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:floor/src/util/primary_key_helper.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:floor_common/src/util/primary_key_helper.dart'; +import 'package:sqflite_common/sqlite_api.dart'; class DeletionAdapter { final DatabaseExecutor _database; diff --git a/floor/lib/src/adapter/insertion_adapter.dart b/floor_common/lib/src/adapter/insertion_adapter.dart similarity index 94% rename from floor/lib/src/adapter/insertion_adapter.dart rename to floor_common/lib/src/adapter/insertion_adapter.dart index 2f584d06..af154a88 100644 --- a/floor/lib/src/adapter/insertion_adapter.dart +++ b/floor_common/lib/src/adapter/insertion_adapter.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'package:floor/src/extension/on_conflict_strategy_extensions.dart'; import 'package:floor_annotation/floor_annotation.dart'; -import 'package:sqflite/sqlite_api.dart'; +import 'package:floor_common/src/extension/on_conflict_strategy_extensions.dart'; +import 'package:sqflite_common/sqlite_api.dart'; class InsertionAdapter { final DatabaseExecutor _database; diff --git a/floor/lib/src/adapter/migration_adapter.dart b/floor_common/lib/src/adapter/migration_adapter.dart similarity index 90% rename from floor/lib/src/adapter/migration_adapter.dart rename to floor_common/lib/src/adapter/migration_adapter.dart index 6e726fd6..58d98a52 100644 --- a/floor/lib/src/adapter/migration_adapter.dart +++ b/floor_common/lib/src/adapter/migration_adapter.dart @@ -1,5 +1,5 @@ -import 'package:floor/src/migration.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:floor_common/src/migration.dart'; +import 'package:sqflite_common/sqlite_api.dart'; // ignore: avoid_classes_with_only_static_members abstract class MigrationAdapter { diff --git a/floor/lib/src/adapter/query_adapter.dart b/floor_common/lib/src/adapter/query_adapter.dart similarity index 98% rename from floor/lib/src/adapter/query_adapter.dart rename to floor_common/lib/src/adapter/query_adapter.dart index d2bbdb11..0a32f169 100644 --- a/floor/lib/src/adapter/query_adapter.dart +++ b/floor_common/lib/src/adapter/query_adapter.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:sqflite/sqflite.dart'; +import 'package:sqflite_common/sqlite_api.dart'; /// This class knows how to execute database queries. class QueryAdapter { diff --git a/floor/lib/src/adapter/update_adapter.dart b/floor_common/lib/src/adapter/update_adapter.dart similarity index 93% rename from floor/lib/src/adapter/update_adapter.dart rename to floor_common/lib/src/adapter/update_adapter.dart index d83bd022..a39a8c75 100644 --- a/floor/lib/src/adapter/update_adapter.dart +++ b/floor_common/lib/src/adapter/update_adapter.dart @@ -1,9 +1,9 @@ import 'dart:async'; -import 'package:floor/src/extension/on_conflict_strategy_extensions.dart'; -import 'package:floor/src/util/primary_key_helper.dart'; import 'package:floor_annotation/floor_annotation.dart'; -import 'package:sqflite/sqlite_api.dart'; +import 'package:floor_common/src/extension/on_conflict_strategy_extensions.dart'; +import 'package:floor_common/src/util/primary_key_helper.dart'; +import 'package:sqflite_common/sqlite_api.dart'; class UpdateAdapter { final DatabaseExecutor _database; diff --git a/floor/lib/src/callback.dart b/floor_common/lib/src/callback.dart similarity index 95% rename from floor/lib/src/callback.dart rename to floor_common/lib/src/callback.dart index b0b558bd..9a25ef7a 100644 --- a/floor/lib/src/callback.dart +++ b/floor_common/lib/src/callback.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:sqflite/sqflite.dart'; +import 'package:sqflite_common/sqlite_api.dart'; /// Callback class that can be attached to the Floor builder. class Callback { diff --git a/floor/lib/src/database.dart b/floor_common/lib/src/database.dart similarity index 92% rename from floor/lib/src/database.dart rename to floor_common/lib/src/database.dart index d8898ac4..5baf0237 100644 --- a/floor/lib/src/database.dart +++ b/floor_common/lib/src/database.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:meta/meta.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; /// Extend this class to enable database functionality. abstract class FloorDatabase { diff --git a/floor_common/lib/src/database_factory_ext.dart b/floor_common/lib/src/database_factory_ext.dart new file mode 100644 index 00000000..8f50ac2b --- /dev/null +++ b/floor_common/lib/src/database_factory_ext.dart @@ -0,0 +1,9 @@ +import 'package:path/path.dart'; +import 'package:sqflite_common/sqlite_api.dart'; + +extension DatabaseFactoryExtension on DatabaseFactory { + Future getDatabasePath(final String name) async { + final databasesPath = await this.getDatabasesPath(); + return join(databasesPath, name); + } +} diff --git a/floor/lib/src/extension/on_conflict_strategy_extensions.dart b/floor_common/lib/src/extension/on_conflict_strategy_extensions.dart similarity index 92% rename from floor/lib/src/extension/on_conflict_strategy_extensions.dart rename to floor_common/lib/src/extension/on_conflict_strategy_extensions.dart index aff8afa0..13898261 100644 --- a/floor/lib/src/extension/on_conflict_strategy_extensions.dart +++ b/floor_common/lib/src/extension/on_conflict_strategy_extensions.dart @@ -1,5 +1,5 @@ import 'package:floor_annotation/floor_annotation.dart'; -import 'package:sqflite/sqlite_api.dart'; +import 'package:sqflite_common/sqlite_api.dart'; extension OnConflictStrategyExtensions on OnConflictStrategy { ConflictAlgorithm asSqfliteConflictAlgorithm() { diff --git a/floor/lib/src/migration.dart b/floor_common/lib/src/migration.dart similarity index 95% rename from floor/lib/src/migration.dart rename to floor_common/lib/src/migration.dart index 25d06da5..8eac3722 100644 --- a/floor/lib/src/migration.dart +++ b/floor_common/lib/src/migration.dart @@ -1,4 +1,4 @@ -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; /// Base class for a database migration. /// diff --git a/floor/lib/src/util/primary_key_helper.dart b/floor_common/lib/src/util/primary_key_helper.dart similarity index 100% rename from floor/lib/src/util/primary_key_helper.dart rename to floor_common/lib/src/util/primary_key_helper.dart diff --git a/floor_common/pubspec.lock b/floor_common/pubspec.lock new file mode 100644 index 00000000..d6d75b67 --- /dev/null +++ b/floor_common/pubspec.lock @@ -0,0 +1,544 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "31.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.3" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.4" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + collection: + dependency: "direct dev" + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + floor_annotation: + dependency: "direct main" + description: + path: "../floor_annotation" + relative: true + source: path + version: "1.0.1" + floor_generator: + dependency: "direct dev" + description: + path: "../floor_generator" + relative: true + source: path + version: "1.3.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" + lists: + dependency: transitive + description: + name: lists + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + matcher: + dependency: "direct dev" + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + meta: + dependency: "direct main" + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + mockito: + dependency: "direct dev" + description: + name: mockito + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.17" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path: + dependency: "direct main" + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.2" + sqflite_common: + dependency: "direct main" + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + sqflite_common_ffi: + dependency: "direct dev" + description: + name: sqflite_common_ffi + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0+2" + sqlite3: + dependency: transitive + description: + name: sqlite3 + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + strings: + dependency: transitive + description: + name: strings + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.2" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test: + dependency: "direct dev" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.20.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.9" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.11" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + unicode: + dependency: transitive + description: + name: unicode + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.1" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.16.0-100.0.dev <3.0.0" diff --git a/floor_common/pubspec.yaml b/floor_common/pubspec.yaml new file mode 100644 index 00000000..bcf22115 --- /dev/null +++ b/floor_common/pubspec.yaml @@ -0,0 +1,27 @@ +name: floor_common +description: > + The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications. + This library is the runtime dependency. +version: 1.2.0 +homepage: https://floor.codes +publish_to: none + +environment: + sdk: '>=2.12.0 <3.0.0' + +dependencies: + floor_annotation: + path: ../floor_annotation/ + meta: ^1.7.0 + path: ^1.8.0 + sqflite_common: ^2.0.1+1 + +dev_dependencies: + build_runner: ^2.1.2 + collection: ^1.15.0 + floor_generator: + path: ../floor_generator/ + sqflite_common_ffi: ^2.0.0+3 + test: ^1.20.1 + matcher: ^0.12.10 + mockito: ^5.0.15 diff --git a/floor/test/adapter/deletion_adapter_test.dart b/floor_common/test/adapter/deletion_adapter_test.dart similarity index 97% rename from floor/test/adapter/deletion_adapter_test.dart rename to floor_common/test/adapter/deletion_adapter_test.dart index 306bf968..4c188c26 100644 --- a/floor/test/adapter/deletion_adapter_test.dart +++ b/floor_common/test/adapter/deletion_adapter_test.dart @@ -1,6 +1,6 @@ -import 'package:floor/src/adapter/deletion_adapter.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/src/adapter/deletion_adapter.dart'; import 'package:mockito/mockito.dart'; +import 'package:test/test.dart'; import '../test_util/mocks.dart'; import '../test_util/person.dart'; diff --git a/floor/test/adapter/insertion_adapter_test.dart b/floor_common/test/adapter/insertion_adapter_test.dart similarity index 98% rename from floor/test/adapter/insertion_adapter_test.dart rename to floor_common/test/adapter/insertion_adapter_test.dart index a905ea2e..f8776d48 100644 --- a/floor/test/adapter/insertion_adapter_test.dart +++ b/floor_common/test/adapter/insertion_adapter_test.dart @@ -1,7 +1,7 @@ -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/floor_common.dart'; import 'package:mockito/mockito.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:test/test.dart'; import '../test_util/mocks.dart'; import '../test_util/person.dart'; diff --git a/floor/test/adapter/migration_adapter_test.dart b/floor_common/test/adapter/migration_adapter_test.dart similarity index 94% rename from floor/test/adapter/migration_adapter_test.dart rename to floor_common/test/adapter/migration_adapter_test.dart index 87f0d147..28cb0b9b 100644 --- a/floor/test/adapter/migration_adapter_test.dart +++ b/floor_common/test/adapter/migration_adapter_test.dart @@ -1,7 +1,7 @@ -import 'package:floor/src/adapter/migration_adapter.dart'; -import 'package:floor/src/migration.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/src/adapter/migration_adapter.dart'; +import 'package:floor_common/src/migration.dart'; import 'package:mockito/mockito.dart'; +import 'package:test/test.dart'; import '../test_util/mocks.dart'; diff --git a/floor/test/adapter/query_adapter_test.dart b/floor_common/test/adapter/query_adapter_test.dart similarity index 98% rename from floor/test/adapter/query_adapter_test.dart rename to floor_common/test/adapter/query_adapter_test.dart index e86f60e8..169ba773 100644 --- a/floor/test/adapter/query_adapter_test.dart +++ b/floor_common/test/adapter/query_adapter_test.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'package:floor/src/adapter/query_adapter.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/src/adapter/query_adapter.dart'; import 'package:mockito/mockito.dart'; +import 'package:test/test.dart'; import '../test_util/mocks.dart'; import '../test_util/person.dart'; diff --git a/floor/test/adapter/update_adapter_test.dart b/floor_common/test/adapter/update_adapter_test.dart similarity index 97% rename from floor/test/adapter/update_adapter_test.dart rename to floor_common/test/adapter/update_adapter_test.dart index 963caa63..5a91f370 100644 --- a/floor/test/adapter/update_adapter_test.dart +++ b/floor_common/test/adapter/update_adapter_test.dart @@ -1,7 +1,7 @@ -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/floor_common.dart'; import 'package:mockito/mockito.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:test/test.dart'; import '../test_util/mocks.dart'; import '../test_util/person.dart'; diff --git a/floor/test/extension/on_conflict_strategy_extensions_test.dart b/floor_common/test/extension/on_conflict_strategy_extensions_test.dart similarity index 84% rename from floor/test/extension/on_conflict_strategy_extensions_test.dart rename to floor_common/test/extension/on_conflict_strategy_extensions_test.dart index bc1d945d..7183bbfb 100644 --- a/floor/test/extension/on_conflict_strategy_extensions_test.dart +++ b/floor_common/test/extension/on_conflict_strategy_extensions_test.dart @@ -1,7 +1,7 @@ -import 'package:floor/floor.dart'; -import 'package:floor/src/extension/on_conflict_strategy_extensions.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:floor_common/floor_common.dart'; +import 'package:floor_common/src/extension/on_conflict_strategy_extensions.dart'; +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:test/test.dart'; void main() { group('asSqfliteConflictAlgorithm', () { diff --git a/floor/test/integration/autoincrement/autoinc_test.dart b/floor_common/test/integration/autoincrement/autoinc_test.dart similarity index 90% rename from floor/test/integration/autoincrement/autoinc_test.dart rename to floor_common/test/integration/autoincrement/autoinc_test.dart index 91d5cf7e..6d90351a 100644 --- a/floor/test/integration/autoincrement/autoinc_test.dart +++ b/floor_common/test/integration/autoincrement/autoinc_test.dart @@ -1,8 +1,10 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import 'package:test/test.dart'; + +import '../../test_util/database_factory.dart'; part 'autoinc_test.g.dart'; diff --git a/floor/test/integration/blob/blob_test.dart b/floor_common/test/integration/blob/blob_test.dart similarity index 89% rename from floor/test/integration/blob/blob_test.dart rename to floor_common/test/integration/blob/blob_test.dart index c332eb18..9ac9f7f3 100644 --- a/floor/test/integration/blob/blob_test.dart +++ b/floor_common/test/integration/blob/blob_test.dart @@ -2,9 +2,11 @@ import 'dart:async'; import 'dart:typed_data'; import 'package:collection/collection.dart'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import 'package:test/test.dart'; + +import '../../test_util/database_factory.dart'; part 'blob_test.g.dart'; diff --git a/floor/test/integration/boolean_conversions/bool_test.dart b/floor_common/test/integration/boolean_conversions/bool_test.dart similarity index 93% rename from floor/test/integration/boolean_conversions/bool_test.dart rename to floor_common/test/integration/boolean_conversions/bool_test.dart index 5e478207..63daa368 100644 --- a/floor/test/integration/boolean_conversions/bool_test.dart +++ b/floor_common/test/integration/boolean_conversions/bool_test.dart @@ -1,8 +1,10 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import 'package:test/test.dart'; + +import '../../test_util/database_factory.dart'; part 'bool_test.g.dart'; diff --git a/floor/test/integration/dao/dog_dao.dart b/floor_common/test/integration/dao/dog_dao.dart similarity index 84% rename from floor/test/integration/dao/dog_dao.dart rename to floor_common/test/integration/dao/dog_dao.dart index c1eb8250..6a658207 100644 --- a/floor/test/integration/dao/dog_dao.dart +++ b/floor_common/test/integration/dao/dog_dao.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import '../model/dog.dart'; diff --git a/floor/test/integration/dao/name_dao.dart b/floor_common/test/integration/dao/name_dao.dart similarity index 94% rename from floor/test/integration/dao/name_dao.dart rename to floor_common/test/integration/dao/name_dao.dart index 16491d05..318ef10d 100644 --- a/floor/test/integration/dao/name_dao.dart +++ b/floor_common/test/integration/dao/name_dao.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import '../model/mutliline_name.dart'; import '../model/name.dart'; diff --git a/floor/test/integration/dao/person_dao.dart b/floor_common/test/integration/dao/person_dao.dart similarity index 98% rename from floor/test/integration/dao/person_dao.dart rename to floor_common/test/integration/dao/person_dao.dart index f4cba460..13f0b157 100644 --- a/floor/test/integration/dao/person_dao.dart +++ b/floor_common/test/integration/dao/person_dao.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import '../model/dog.dart'; import '../model/person.dart'; diff --git a/floor/test/integration/database.dart b/floor_common/test/integration/database.dart similarity index 66% rename from floor/test/integration/database.dart rename to floor_common/test/integration/database.dart index 58335e3d..5b73f708 100644 --- a/floor/test/integration/database.dart +++ b/floor_common/test/integration/database.dart @@ -1,8 +1,9 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:sqflite/sqlite_api.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import '../test_util/database_factory.dart'; import 'dao/dog_dao.dart'; import 'dao/person_dao.dart'; import 'model/dog.dart'; diff --git a/floor/test/integration/database_test.dart b/floor_common/test/integration/database_test.dart similarity index 99% rename from floor/test/integration/database_test.dart rename to floor_common/test/integration/database_test.dart index f4d94f1e..28dfe5cc 100644 --- a/floor/test/integration/database_test.dart +++ b/floor_common/test/integration/database_test.dart @@ -1,6 +1,6 @@ -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart'; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:test/test.dart'; import '../test_util/extensions.dart'; import 'dao/dog_dao.dart'; diff --git a/floor/test/integration/fts/mail.dart b/floor_common/test/integration/fts/mail.dart similarity index 92% rename from floor/test/integration/fts/mail.dart rename to floor_common/test/integration/fts/mail.dart index 8a3fafe3..d7d5fe67 100644 --- a/floor/test/integration/fts/mail.dart +++ b/floor_common/test/integration/fts/mail.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; @Entity( tableName: 'mail', diff --git a/floor/test/integration/fts/mail_dao.dart b/floor_common/test/integration/fts/mail_dao.dart similarity index 93% rename from floor/test/integration/fts/mail_dao.dart rename to floor_common/test/integration/fts/mail_dao.dart index df1b7311..3ffce0e1 100644 --- a/floor/test/integration/fts/mail_dao.dart +++ b/floor_common/test/integration/fts/mail_dao.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import 'mail.dart'; diff --git a/floor/test/integration/fts/mail_database.dart b/floor_common/test/integration/fts/mail_database.dart similarity index 57% rename from floor/test/integration/fts/mail_database.dart rename to floor_common/test/integration/fts/mail_database.dart index 4881f33e..631ad9fc 100644 --- a/floor/test/integration/fts/mail_database.dart +++ b/floor_common/test/integration/fts/mail_database.dart @@ -1,8 +1,9 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import '../../test_util/database_factory.dart'; import 'mail.dart'; import 'mail_dao.dart'; diff --git a/floor/test/integration/fts/mail_database_test.dart b/floor_common/test/integration/fts/mail_database_test.dart similarity index 98% rename from floor/test/integration/fts/mail_database_test.dart rename to floor_common/test/integration/fts/mail_database_test.dart index 9979cb04..c74b105b 100644 --- a/floor/test/integration/fts/mail_database_test.dart +++ b/floor_common/test/integration/fts/mail_database_test.dart @@ -1,4 +1,4 @@ -import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; import 'mail.dart'; import 'mail_dao.dart'; diff --git a/floor/test/integration/inheritance/dao_inheritance_test.dart b/floor_common/test/integration/inheritance/dao_inheritance_test.dart similarity index 88% rename from floor/test/integration/inheritance/dao_inheritance_test.dart rename to floor_common/test/integration/inheritance/dao_inheritance_test.dart index 2e13411d..e2d2c087 100644 --- a/floor/test/integration/inheritance/dao_inheritance_test.dart +++ b/floor_common/test/integration/inheritance/dao_inheritance_test.dart @@ -1,8 +1,10 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:test/test.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; + +import '../../test_util/database_factory.dart'; part 'dao_inheritance_test.g.dart'; diff --git a/floor/test/integration/inheritance/entity_inheritance_test.dart b/floor_common/test/integration/inheritance/entity_inheritance_test.dart similarity index 92% rename from floor/test/integration/inheritance/entity_inheritance_test.dart rename to floor_common/test/integration/inheritance/entity_inheritance_test.dart index c32162d8..9fd74438 100644 --- a/floor/test/integration/inheritance/entity_inheritance_test.dart +++ b/floor_common/test/integration/inheritance/entity_inheritance_test.dart @@ -1,8 +1,10 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import 'package:test/test.dart'; + +import '../../test_util/database_factory.dart'; part 'entity_inheritance_test.g.dart'; diff --git a/floor/test/integration/model/dog.dart b/floor_common/test/integration/model/dog.dart similarity index 95% rename from floor/test/integration/model/dog.dart rename to floor_common/test/integration/model/dog.dart index 2e2ff55b..cca83378 100644 --- a/floor/test/integration/model/dog.dart +++ b/floor_common/test/integration/model/dog.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import 'person.dart'; diff --git a/floor/test/integration/model/mutliline_name.dart b/floor_common/test/integration/model/mutliline_name.dart similarity index 91% rename from floor/test/integration/model/mutliline_name.dart rename to floor_common/test/integration/model/mutliline_name.dart index f8954afe..b0d05817 100644 --- a/floor/test/integration/model/mutliline_name.dart +++ b/floor_common/test/integration/model/mutliline_name.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; @DatabaseView( ''' diff --git a/floor/test/integration/model/name.dart b/floor_common/test/integration/model/name.dart similarity index 90% rename from floor/test/integration/model/name.dart rename to floor_common/test/integration/model/name.dart index a465cb40..20006b9b 100644 --- a/floor/test/integration/model/name.dart +++ b/floor_common/test/integration/model/name.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; @DatabaseView( 'SELECT custom_name as name FROM person UNION SELECT name from dog', diff --git a/floor/test/integration/model/person.dart b/floor_common/test/integration/model/person.dart similarity index 92% rename from floor/test/integration/model/person.dart rename to floor_common/test/integration/model/person.dart index 5bdafe89..bfc9995d 100644 --- a/floor/test/integration/model/person.dart +++ b/floor_common/test/integration/model/person.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; @Entity( tableName: 'person', diff --git a/floor/test/integration/stream_query_test.dart b/floor_common/test/integration/stream_query_test.dart similarity index 99% rename from floor/test/integration/stream_query_test.dart rename to floor_common/test/integration/stream_query_test.dart index 26d3b99e..977d09ab 100644 --- a/floor/test/integration/stream_query_test.dart +++ b/floor_common/test/integration/stream_query_test.dart @@ -1,4 +1,4 @@ -import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; import '../test_util/extensions.dart'; import 'dao/person_dao.dart'; diff --git a/floor/test/integration/type_converter/order.dart b/floor_common/test/integration/type_converter/order.dart similarity index 90% rename from floor/test/integration/type_converter/order.dart rename to floor_common/test/integration/type_converter/order.dart index f5a9bdb8..5eec43a3 100644 --- a/floor/test/integration/type_converter/order.dart +++ b/floor_common/test/integration/type_converter/order.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; @entity class Order { diff --git a/floor/test/integration/type_converter/order_dao.dart b/floor_common/test/integration/type_converter/order_dao.dart similarity index 87% rename from floor/test/integration/type_converter/order_dao.dart rename to floor_common/test/integration/type_converter/order_dao.dart index 3a183874..d004afd2 100644 --- a/floor/test/integration/type_converter/order_dao.dart +++ b/floor_common/test/integration/type_converter/order_dao.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; import 'order.dart'; diff --git a/floor/test/integration/type_converter/order_database.dart b/floor_common/test/integration/type_converter/order_database.dart similarity index 64% rename from floor/test/integration/type_converter/order_database.dart rename to floor_common/test/integration/type_converter/order_database.dart index eedc7201..5cdfd1c3 100644 --- a/floor/test/integration/type_converter/order_database.dart +++ b/floor_common/test/integration/type_converter/order_database.dart @@ -1,8 +1,9 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import '../../test_util/database_factory.dart'; import 'order.dart'; import 'order_dao.dart'; import 'type_converter.dart'; diff --git a/floor/test/integration/type_converter/type_converter.dart b/floor_common/test/integration/type_converter/type_converter.dart similarity index 84% rename from floor/test/integration/type_converter/type_converter.dart rename to floor_common/test/integration/type_converter/type_converter.dart index e66e614a..a4867a17 100644 --- a/floor/test/integration/type_converter/type_converter.dart +++ b/floor_common/test/integration/type_converter/type_converter.dart @@ -1,4 +1,4 @@ -import 'package:floor/floor.dart'; +import 'package:floor_common/floor_common.dart'; class DateTimeConverter extends TypeConverter { @override diff --git a/floor/test/integration/type_converter/type_converter_database_test.dart b/floor_common/test/integration/type_converter/type_converter_database_test.dart similarity index 95% rename from floor/test/integration/type_converter/type_converter_database_test.dart rename to floor_common/test/integration/type_converter/type_converter_database_test.dart index 5a0ccc5e..b6199988 100644 --- a/floor/test/integration/type_converter/type_converter_database_test.dart +++ b/floor_common/test/integration/type_converter/type_converter_database_test.dart @@ -1,4 +1,4 @@ -import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; import 'order.dart'; import 'order_dao.dart'; diff --git a/floor/test/integration/type_converter/type_converter_test.dart b/floor_common/test/integration/type_converter/type_converter_test.dart similarity index 92% rename from floor/test/integration/type_converter/type_converter_test.dart rename to floor_common/test/integration/type_converter/type_converter_test.dart index c19d4168..0da29dfa 100644 --- a/floor/test/integration/type_converter/type_converter_test.dart +++ b/floor_common/test/integration/type_converter/type_converter_test.dart @@ -1,4 +1,4 @@ -import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; import 'type_converter.dart'; diff --git a/floor/test/integration/view/view_test.dart b/floor_common/test/integration/view/view_test.dart similarity index 95% rename from floor/test/integration/view/view_test.dart rename to floor_common/test/integration/view/view_test.dart index 997bb1b0..a1f0c96f 100644 --- a/floor/test/integration/view/view_test.dart +++ b/floor_common/test/integration/view/view_test.dart @@ -1,9 +1,10 @@ import 'dart:async'; -import 'package:floor/floor.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; +import 'package:floor_common/floor_common.dart'; +import 'package:sqflite_common/sqlite_api.dart' as sqflite; +import 'package:test/test.dart'; +import '../../test_util/database_factory.dart'; import '../dao/dog_dao.dart'; import '../dao/name_dao.dart'; import '../dao/person_dao.dart'; diff --git a/floor_common/test/test_util/database_factory.dart b/floor_common/test/test_util/database_factory.dart new file mode 100644 index 00000000..431afd6a --- /dev/null +++ b/floor_common/test/test_util/database_factory.dart @@ -0,0 +1,8 @@ +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; + +// infers factory as nullable without explicit type definition +final DatabaseFactory sqfliteDatabaseFactory = () { + sqfliteFfiInit(); + return databaseFactoryFfi; +}(); diff --git a/floor/test/test_util/extensions.dart b/floor_common/test/test_util/extensions.dart similarity index 100% rename from floor/test/test_util/extensions.dart rename to floor_common/test/test_util/extensions.dart diff --git a/floor/test/test_util/mocks.dart b/floor_common/test/test_util/mocks.dart similarity index 100% rename from floor/test/test_util/mocks.dart rename to floor_common/test/test_util/mocks.dart diff --git a/floor/test/test_util/person.dart b/floor_common/test/test_util/person.dart similarity index 100% rename from floor/test/test_util/person.dart rename to floor_common/test/test_util/person.dart diff --git a/floor/test/util/primary_key_helper_test.dart b/floor_common/test/util/primary_key_helper_test.dart similarity index 94% rename from floor/test/util/primary_key_helper_test.dart rename to floor_common/test/util/primary_key_helper_test.dart index ac4c1707..3f8ff72a 100644 --- a/floor/test/util/primary_key_helper_test.dart +++ b/floor_common/test/util/primary_key_helper_test.dart @@ -1,5 +1,5 @@ -import 'package:floor/src/util/primary_key_helper.dart'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:floor_common/src/util/primary_key_helper.dart'; +import 'package:test/test.dart'; void main() { group('Primary key WHERE clause', () { diff --git a/floor_ffi/.metadata b/floor_ffi/.metadata new file mode 100644 index 00000000..2ec1df35 --- /dev/null +++ b/floor_ffi/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b + channel: beta + +project_type: package diff --git a/floor_ffi/CHANGELOG.md b/floor_ffi/CHANGELOG.md new file mode 100644 index 00000000..cf125525 --- /dev/null +++ b/floor_ffi/CHANGELOG.md @@ -0,0 +1,344 @@ +# Changelog + +## 1.2.0 + +### Changes + +* Improve escaping by using library + +### 🐛 Bug Fixes + +* Bugfix/nullable transaction return + +### 🛠 Maintenance + +* Update dependencies + +## 1.1.0 + +All credits for this release go to mqus. + +### Changes + +* Update deps +* Increase test coverage +* Bump locked floor_generator version to 1.0.1 + +### 🚀 Features + +* Add onConfigure callback + +### 🐛 Bug Fixes + +* Retain index ordering + +## 1.0.1 + +### Changes + +* Bump mockito to 5.0.3 +* Update dependencies to null-safe versions + +### 🚀 Features + +* Improved Parameter mapping for query methods + +## 1.0.0 + +### Changes + +* Use stable Dart 2.12.0 + +### 🚀 Features + +* Make floor null-safe + +## 0.19.1 + +### Changes + +* Remove floor example to pass static analysis + +## 0.19.0 + +### Changes + +* Update website theme +* Update license with all authors +* Fix getting started syntax highlighting +* Improve FTS documentation +* Introduce tab navigation to website +* Fix typo in doc title +* Improve website +* Slim down README +* Create MkDocs website +* Add isolates section to README +* Run CI only on pushes to develop +* Use GitHub Discussions for ideas and feedback +* Add example to floor package + +### 🚀 Features + +* Add Full-text Search support + +### 🐛 Bug Fixes + +* Fix desktop database path retrieval + +## 0.18.0 + +* Documentation update on DateTimeConverter sample +* Change ForeignKeyAction to enum in the generator +* Add primary key auto increment test + +### 🚀 Features + +* Add support for WITH statements for DatabaseViews + +### 🐛 Bug Fixes + +* More tolerant query with list parameter parsing + +## 0.17.0 + +### 🐛 Bug Fixes + +* Generate distinct type converter instances +* Fix generation of DAO method with list argument using type converters + +## 0.16.0 + +### 🚀 Features + +* Add **experimental** support for type converters + +## 0.15.0 + +### Changes + +* Update dependencies + +### 🚀 Features + +* Add support for WITHOUT ROWID tables +* Check transaction method return types and allow non-void returns + +## 0.14.0 + +### Changes + +* Document entity inheritance and add integration test +* Raise minimum sqflite version to 1.3.0 +* add integration test for transaction rollback +* Mention missing null propagation in streams +* Fix types (integer instead of real) + +## 0.13.0 + +### ⚠️ Breaking Changes + +**You need to migrate the explicit usages of `OnConflictStrategy` and `ForeignKeyAction` from snake +case to camel case.** + +* Apply camel case to constants + +### Changes + +* Mention SQL centricity of Floor in README +* Add banner to README +* Update the description of the library +* Migrate OnConflictStrategy to enum +* Add more precise limitations of entity class and streams to README +* Add DAO inheritance example to README +* Fix database and DAO usage example in the README +* Update README.md +* Assert example app's behavior +* Mention that floor uses first constructor found in entity class +* Remove snapshot version instructions from README + +### 🚀 Features + +* Support Linux, macOS, Windows +* Implement simple Streams on DatabaseViews, fix multi-dao changelistener + +### 🐛 Bug Fixes + +* Await database path retrieval +* Fix boolean conversion issues, add regression test, fix indentation +* Fix wrongly parsed arguments in @Query + +## 0.12.0 + +### Changes + +* Ignore Getters&Setters +* Use Flutter bundled pub to get and upgrade project dependencies +* Generate database implementation on every CI run +* Throw exception when querying for unsupported type +* Add generated code for example app +* Add workflow scripts +* Run real database tests on development machine and CI + +### 🚀 Features + +* Support ByteArrays/Blobs +* Support inherited fields for entities and views +* Support database views +* Support inherited DAO methods +* Support asynchronous migrations + +### 🐛 Bug Fixes + +* Fix failing SQLite installation process on CI +* Fix failing stream query test + +## 0.11.0 + +### Changes + +* Refactor string utility function into extension function +* Refactor annotation check functions to use extension functions +* Refactor type check functions to use extension functions + +### 🚀 Features + +* Ignore fields of entities by adding ignore annotation +* Handle named constructor parameters and ignore field order +* Exclude static fields from entity mapping + +## 0.10.0 + +### Changes + +* Update dependencies +* Update README with correct instructions to initialize in memory database + +### 🐛 Bug Fixes + +* Make in-memory database actually be just in memory + +## 0.9.0 + +### 🐛 Bug Fixes + +* Make IN clauses work with strings +* Fix foreign key action string representation + +## 0.8.0 + +### Changes + +* Update README with clear package import instructions + +### 🚀 Features + +* Introduce static 'to map' functions +* Add optional callback functions when opening database + +### 🐛 Bug Fixes + +* Allow int and string (composite) primary keys + +## 0.7.0 + +### 🐛 Bug Fixes + +* Retain reactivity when using transactions + +## 0.6.0 + +### 🚀 Features + +* Add support for IN clauses in query statements +* Enable compound primary keys + +## 0.5.0 + +### Changes + +* Make tasks deletable in example app + +### 🚀 Features + +* Allow multiline string queries +* Allow void-return queries with arguments + +## 0.4.2 + +### 🐛 Bug Fixes + +* Fix query parameter substitution regex + +## 0.4.0 + +### Changes + +* Enable coverage report +* Simplify type assertions and add tests + +### 🚀 Features + +* Allow more convenient database initialization + +### 🐛 Bug Fixes + +* Use query argument binding instead of manual binding + +## 0.3.0 + +### Changes + +* Use TypeChecker for all annotations +* Add publishing instructions +* Remove unused annotation names +* Simplify the mapping from an entity to a map +* Fix database writer test +* Make stream emit query result on subscription +* Update example to use StreamBuilder +* Update README + +### 🐛 Bug Fixes + +* Correct mapper instance name referenced by generated query methods +* Fix adapter instances naming + +## 0.2.0 + +### Changes + +* Add database adapters +* Run floor Flutter tests +* Move value objects to value_objects directory +* Map source elements into value objects in processors +* Use GeneratorForAnnotation and TypeChecker to verify annotations +* Throw more specific errors on obfuscated database annotation + +### 🚀 Features + +* Add support for migrations +* Add support for returning Streams as query result +* Support accessing data from Data Access Objects +* Add entity classes to database annotation +* Add support for indices + +## 0.1.0 + +### 🚀 Features + +* Support conflict strategies when inserting and updating records +* Add support for running queries that return void +* Add support for foreign keys +* Add parameter verification for query methods +* Return deleted row count on delete +* Return updated rows count on update +* Return ID/s of inserted item/s +* Add support for transactions +* Add support for changing (insert, update, delete) lists +* Support custom entity name +* Enable NOT NULL columns +* Enable custom column name mapping +* Add delete methods code generation and fix update methods +* Add update methods code generation +* Add insert methods code generation +* Add code generator for query methods +* Code generation for database creation diff --git a/floor_ffi/LICENSE b/floor_ffi/LICENSE new file mode 100644 index 00000000..dd5b3a58 --- /dev/null +++ b/floor_ffi/LICENSE @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/floor_ffi/lib/floor_ffi.dart b/floor_ffi/lib/floor_ffi.dart new file mode 100644 index 00000000..9d108537 --- /dev/null +++ b/floor_ffi/lib/floor_ffi.dart @@ -0,0 +1,2 @@ +export 'package:floor_common/floor_common.dart'; +export 'package:floor_ffi/src/sqflite_database_factory.dart'; diff --git a/floor_ffi/lib/src/sqflite_database_factory.dart b/floor_ffi/lib/src/sqflite_database_factory.dart new file mode 100644 index 00000000..431afd6a --- /dev/null +++ b/floor_ffi/lib/src/sqflite_database_factory.dart @@ -0,0 +1,8 @@ +import 'package:sqflite_common/sqlite_api.dart'; +import 'package:sqflite_common_ffi/sqflite_ffi.dart'; + +// infers factory as nullable without explicit type definition +final DatabaseFactory sqfliteDatabaseFactory = () { + sqfliteFfiInit(); + return databaseFactoryFfi; +}(); diff --git a/floor_ffi/pubspec.lock b/floor_ffi/pubspec.lock new file mode 100644 index 00000000..eee60c1d --- /dev/null +++ b/floor_ffi/pubspec.lock @@ -0,0 +1,75 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + floor_annotation: + dependency: "direct main" + description: + path: "../floor_annotation" + relative: true + source: path + version: "1.0.1" + floor_common: + dependency: "direct main" + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" + meta: + dependency: "direct main" + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: "direct main" + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1+1" + sqflite_common_ffi: + dependency: "direct main" + description: + name: sqflite_common_ffi + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0+3" + sqlite3: + dependency: transitive + description: + name: sqlite3 + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" +sdks: + dart: ">=2.12.0 <3.0.0" diff --git a/floor_ffi/pubspec.yaml b/floor_ffi/pubspec.yaml new file mode 100644 index 00000000..a6084ba7 --- /dev/null +++ b/floor_ffi/pubspec.yaml @@ -0,0 +1,19 @@ +name: floor_ffi +description: > + The typesafe, reactive, and lightweight SQLite abstraction for your Flutter applications. + This library is the runtime dependency. +version: 1.2.0 +homepage: https://floor.codes +publish_to: none + +environment: + sdk: '>=2.12.0 <3.0.0' + +dependencies: + floor_annotation: + path: ../floor_annotation/ + floor_common: + path: ../floor_common/ + meta: ^1.7.0 + path: ^1.8.0 + sqflite_common_ffi: ^2.0.0+3 From 584de06f7534a2f9e6eab33bc6c7e01bd11e075a Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 12 Mar 2024 13:41:26 +0100 Subject: [PATCH 02/22] pub lock --- example/pubspec.lock | 278 ++++++++++++++------- floor/pubspec.lock | 467 +++-------------------------------- floor_common/pubspec.lock | 227 +++++++++++------ floor_ffi/pubspec.lock | 26 +- floor_generator/pubspec.lock | 212 ++++++++++------ 5 files changed, 535 insertions(+), 675 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 5654693d..2d0c58e9 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,189 +5,216 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: abaaefb52aed804f123186fd1c7b789c46aab208dd9b100218c8659056e5fa8a + url: "https://pub.dev" source: hosted version: "33.0.0" analyzer: dependency: "direct dev" description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "4b07ea4b3e22f230f55ef8248cb8ee2763e4f2b605070eae2b6de45b7f37cde2" + url: "https://pub.dev" source: hosted version: "3.1.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "0bd9a99b6eb96f07af141f0eb53eace8983e8e5aa5de59777aca31684680ef22" + url: "https://pub.dev" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: c9b6c412967d7887e88efe1ffbfe0f31bfaf6a5a4b98eb8d59964977a90f2f9e + url: "https://pub.dev" source: hosted version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: ad77deb6e9c143a3f550fbb4c5c1e0c6aadabe24274898d06b9526c61b9cf4fb + url: "https://pub.dev" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "4e2dbfa914f99bca9c447ba5aaa572edf7335a71717944e4ab2e26ca079e7f79" + url: "https://pub.dev" source: hosted version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "4666aef1d045c5ca15ebba63e400bd4e4fbd9f0dd06e791b51ab210da78a27f7" + url: "https://pub.dev" source: hosted version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: e090beee726671ff68747cb4d8c9151704864ec9a5dc88db9fe6441c24b3fa55 + url: "https://pub.dev" source: hosted version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: f4d6244cc071ba842c296cb1c4ee1b31596b9f924300647ac7a1445493471a3f + url: "https://pub.dev" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: b6c9911b2d670376918d5b8779bc27e0e612a94ec3ff0343689e991d8d0a3b8a + url: "https://pub.dev" source: hosted version: "8.1.4" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" source: hosted version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: bdb1ab29be158c4784d7f9b7b693745a0719c5899e31c01112782bb1cb871e80 + url: "https://pub.dev" source: hosted version: "4.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.18.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d + url: "https://pub.dev" source: hosted version: "3.0.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "6e8086e1d3c2f6bc15056ee248c4ddc48c2bc71287c0961bf801a08633ed4333" + url: "https://pub.dev" source: hosted version: "2.2.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" + url: "https://pub.dev" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + url: "https://pub.dev" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "6a2ef17156f4dc49684f9d99aaf4a93aba8ac49f5eac861755f5730ddf6e2e4e" + url: "https://pub.dev" source: hosted version: "1.0.0" floor: @@ -232,140 +259,192 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032" + url: "https://pub.dev" source: hosted version: "2.1.2" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" + url: "https://pub.dev" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c + url: "https://pub.dev" source: hosted version: "2.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 + url: "https://pub.dev" source: hosted version: "3.0.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: d9bdfd70d828eeb352390f81b18d6a354ef2044aa28ef25682079797fa7cd174 + url: "https://pub.dev" source: hosted version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: "2639efc0237c7b71c6584696c0847ea4e4733ddaf571ae9c79d5295e8ae17272" + url: "https://pub.dev" source: hosted version: "4.4.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lists: dependency: transitive description: name: lists - url: "https://pub.dartlang.org" + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" source: hosted version: "1.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.8.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.11.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: fd5f81041e6a9fc9b9d7fa2cb8a01123f9f5d5d49136e06cb9dc7d33689529f4 + url: "https://pub.dev" source: hosted version: "1.0.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 + url: "https://pub.dev" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.0" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" + url: "https://pub.dev" source: hosted version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: b5a5fcc6425ea43704852ba4453ba94b08c2226c63418a260240c3a054579014 + url: "https://pub.dev" source: hosted version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "3686efe4a4613a4449b1a4ae08670aadbd3376f2e78d93e3f8f0919db02a7256" + url: "https://pub.dev" source: hosted version: "1.2.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: c240984c924796e055e831a0a36db23be8cb04f170b26df572931ab36418421d + url: "https://pub.dev" source: hosted version: "1.2.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d + url: "https://pub.dev" source: hosted version: "1.0.1" sky_engine: @@ -377,149 +456,178 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: d5aa894fcfa327e19196d6f4f733597a10b42a7e55c8cb2b0dd60d7e7d27dccf + url: "https://pub.dev" source: hosted version: "1.2.1" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.dartlang.org" + sha256: f83e4c46d693b02436348a3a8693fa0fa50b0d98eeb55afc7579b70b0d8967f6 + url: "https://pub.dev" source: hosted version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: c65f003175e4d0559af8180000eec451479b1017bd6c7a7d446c9ae3fecbea0a + url: "https://pub.dev" source: hosted version: "2.2.0" sqflite_common_ffi: dependency: transitive description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: "752d05f2bac0c1d68b19b8c9c3cb9a854af4f58ee71694b55a00512ead14db12" + url: "https://pub.dev" source: hosted version: "2.1.0+1" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: "88009712a98743bd476111c03d8064aea7ae12650a66ca62f866e121c3380d90" + url: "https://pub.dev" source: hosted version: "1.5.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" strings: dependency: transitive description: name: strings - url: "https://pub.dartlang.org" + sha256: "5af86299505c299640f5564e187c1a2ee9d6308c540e8d65f6385f5c67019122" + url: "https://pub.dev" source: hosted version: "0.2.2" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + url: "https://pub.dev" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.6.1" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + url: "https://pub.dev" source: hosted version: "1.0.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" unicode: dependency: transitive description: name: unicode - url: "https://pub.dartlang.org" + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" source: hosted version: "0.3.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "0c2ada1b1aeb2ad031ca81872add6be049b8cb479262c6ad3c4b0f9c24eaab2f" + url: "https://pub.dev" source: hosted version: "2.1.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" + url: "https://pub.dev" source: hosted version: "3.1.0" sdks: - dart: ">=2.15.0 <3.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=1.10.0" diff --git a/floor/pubspec.lock b/floor/pubspec.lock index 49770b02..9f838e4c 100644 --- a/floor/pubspec.lock +++ b/floor/pubspec.lock @@ -1,193 +1,28 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "25.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "8.0.5" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "1.3.0" collection: - dependency: "direct dev" - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - convert: dependency: transitive description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.18.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.0" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" + sha256: d97fffd9d86f3dccc7a9059128b468a99320c69007cc9d41a3a1bda07d4e86dc + url: "https://pub.dev" source: hosted version: "1.0.0" floor_annotation: @@ -204,324 +39,88 @@ packages: relative: true source: path version: "1.2.0" - floor_generator: - dependency: "direct dev" - description: - path: "../floor_generator" - relative: true - source: path - version: "1.3.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - io: + material_color_utilities: dependency: transitive description: - name: io - url: "https://pub.dartlang.org" + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "1.0.0" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - lists: - dependency: transitive - description: - name: lists - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: "direct dev" - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" + version: "0.8.0" meta: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - mockito: - dependency: "direct dev" - description: - name: mockito - url: "https://pub.dartlang.org" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" source: hosted - version: "5.0.15" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" + version: "1.11.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + url: "https://pub.dev" source: hosted version: "1.8.0" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.0" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" sqflite: dependency: "direct main" description: name: sqflite - url: "https://pub.dartlang.org" + sha256: "67fa2c957a8370971fe544542ea1a0d58a07a50c12db46971a86de6ffbe905c2" + url: "https://pub.dev" source: hosted version: "2.0.0+4" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "75e99c238f22152669c39e02a3cdcf78515d11856a8a78e0136452943404d9bd" + url: "https://pub.dev" source: hosted version: "2.0.1+1" sqflite_common_ffi: dependency: "direct main" description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: "29566b30e9bc81731e02dcf314437d9d9af8326f1a9f485cf8b510092287b75f" + url: "https://pub.dev" source: hosted version: "2.0.0+3" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: e41c802d493ab234cb4d1c8c51f8542f77192038a6f373b886346bad00ba4b84 + url: "https://pub.dev" source: hosted version: "1.0.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - strings: - dependency: transitive - description: - name: strings - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + url: "https://pub.dev" source: hosted version: "3.0.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.3" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - unicode: - dependency: transitive - description: - name: unicode - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "2.1.4" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=1.10.0" diff --git a/floor_common/pubspec.lock b/floor_common/pubspec.lock index d6d75b67..1efeb363 100644 --- a/floor_common/pubspec.lock +++ b/floor_common/pubspec.lock @@ -5,182 +5,208 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "4826f97faae3af9761f26c52e56b2aa5ffd18d2c1721d984ad85137721c25f43" + url: "https://pub.dev" source: hosted version: "31.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "7337610c3f9cd13e6b7c6bb0f410644091cf63c9a1436e73352a70f3286abb03" + url: "https://pub.dev" source: hosted version: "2.8.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "0bd9a99b6eb96f07af141f0eb53eace8983e8e5aa5de59777aca31684680ef22" + url: "https://pub.dev" source: hosted version: "2.3.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: db4766341bd8ecb66556f31ab891a5d596ef829221993531bd64a8e6342f0cda + url: "https://pub.dev" source: hosted version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72" + url: "https://pub.dev" source: hosted version: "2.1.0" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: c9b6c412967d7887e88efe1ffbfe0f31bfaf6a5a4b98eb8d59964977a90f2f9e + url: "https://pub.dev" source: hosted version: "2.2.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: ad77deb6e9c143a3f550fbb4c5c1e0c6aadabe24274898d06b9526c61b9cf4fb + url: "https://pub.dev" source: hosted version: "1.0.0" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "4e2dbfa914f99bca9c447ba5aaa572edf7335a71717944e4ab2e26ca079e7f79" + url: "https://pub.dev" source: hosted version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "4666aef1d045c5ca15ebba63e400bd4e4fbd9f0dd06e791b51ab210da78a27f7" + url: "https://pub.dev" source: hosted version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: e090beee726671ff68747cb4d8c9151704864ec9a5dc88db9fe6441c24b3fa55 + url: "https://pub.dev" source: hosted version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: f4d6244cc071ba842c296cb1c4ee1b31596b9f924300647ac7a1445493471a3f + url: "https://pub.dev" source: hosted version: "7.2.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: b6c9911b2d670376918d5b8779bc27e0e612a94ec3ff0343689e991d8d0a3b8a + url: "https://pub.dev" source: hosted version: "8.1.4" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: d5be1994ae6e849331a4fb182450792ad772f375f973fdfd61d6e008766b65cc + url: "https://pub.dev" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" source: hosted version: "0.3.5" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: bdb1ab29be158c4784d7f9b7b693745a0719c5899e31c01112782bb1cb871e80 + url: "https://pub.dev" source: hosted version: "4.1.0" collection: dependency: "direct dev" description: name: collection - url: "https://pub.dartlang.org" + sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762" + url: "https://pub.dev" source: hosted version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d + url: "https://pub.dev" source: hosted version: "3.0.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: c0122af6b3548369d6b7830c7a140d85c9a988d8d29c4976aa9ce4de46b122ef + url: "https://pub.dev" source: hosted version: "1.1.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "6e8086e1d3c2f6bc15056ee248c4ddc48c2bc71287c0961bf801a08633ed4333" + url: "https://pub.dev" source: hosted version: "2.2.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" + url: "https://pub.dev" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + url: "https://pub.dev" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "6a2ef17156f4dc49684f9d99aaf4a93aba8ac49f5eac861755f5730ddf6e2e4e" + url: "https://pub.dev" source: hosted version: "1.0.0" floor_annotation: @@ -201,344 +227,393 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032" + url: "https://pub.dev" source: hosted version: "2.1.2" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" + url: "https://pub.dev" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c + url: "https://pub.dev" source: hosted version: "2.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 + url: "https://pub.dev" source: hosted version: "3.0.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: a5e201311cb08bf3912ebbe9a2be096e182d703f881136ec1e81a2338a9e120d + url: "https://pub.dev" source: hosted version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: "2639efc0237c7b71c6584696c0847ea4e4733ddaf571ae9c79d5295e8ae17272" + url: "https://pub.dev" source: hosted version: "4.4.0" lists: dependency: transitive description: name: lists - url: "https://pub.dartlang.org" + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" source: hosted version: "1.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: "direct dev" description: name: matcher - url: "https://pub.dartlang.org" + sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a" + url: "https://pub.dev" source: hosted version: "0.12.11" meta: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" + sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485" + url: "https://pub.dev" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: fd5f81041e6a9fc9b9d7fa2cb8a01123f9f5d5d49136e06cb9dc7d33689529f4 + url: "https://pub.dev" source: hosted version: "1.0.1" mockito: dependency: "direct dev" description: name: mockito - url: "https://pub.dartlang.org" + sha256: b3d226c3ee1aa60b782eb9479fd7baa2e31eaaabc04781ba4711d62ed56fccd6 + url: "https://pub.dev" source: hosted version: "5.0.17" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + url: "https://pub.dev" source: hosted version: "2.0.1" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 + url: "https://pub.dev" source: hosted version: "2.0.2" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "240ed0e9bd73daa2182e33c4efc68c7dd53c7c656f3da73515a2d163e151412d" + url: "https://pub.dev" source: hosted version: "1.8.1" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" + url: "https://pub.dev" source: hosted version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: b5a5fcc6425ea43704852ba4453ba94b08c2226c63418a260240c3a054579014 + url: "https://pub.dev" source: hosted version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "3686efe4a4613a4449b1a4ae08670aadbd3376f2e78d93e3f8f0919db02a7256" + url: "https://pub.dev" source: hosted version: "1.2.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: c240984c924796e055e831a0a36db23be8cb04f170b26df572931ab36418421d + url: "https://pub.dev" source: hosted version: "1.2.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: e0b44ebddec91e70a713e13adf93c1b2100821303b86a18e1ef1d082bd8bd9b8 + url: "https://pub.dev" source: hosted version: "3.0.0" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: "4a0d12cd512aa4fc55fed5f6280f02ef183f47ba29b4b0dfd621b1c99b7e6361" + url: "https://pub.dev" source: hosted version: "1.1.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d + url: "https://pub.dev" source: hosted version: "1.0.1" source_gen: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: d5aa894fcfa327e19196d6f4f733597a10b42a7e55c8cb2b0dd60d7e7d27dccf + url: "https://pub.dev" source: hosted version: "1.2.1" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" + url: "https://pub.dev" source: hosted version: "2.1.0" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" + url: "https://pub.dev" source: hosted version: "0.10.10" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: d77dbb9d0b7469d91e42d352334b2b4bbd5cec4379542f1bdb630db368c4d9f6 + url: "https://pub.dev" source: hosted version: "1.8.2" sqflite_common: dependency: "direct main" description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: c65f003175e4d0559af8180000eec451479b1017bd6c7a7d446c9ae3fecbea0a + url: "https://pub.dev" source: hosted version: "2.2.0" sqflite_common_ffi: dependency: "direct dev" description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: "1756ff13ce9c078d977068954187d0efc1cd3d6d450f7147b2cae486acf01806" + url: "https://pub.dev" source: hosted version: "2.1.0+2" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: "88009712a98743bd476111c03d8064aea7ae12650a66ca62f866e121c3380d90" + url: "https://pub.dev" source: hosted version: "1.5.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774 + url: "https://pub.dev" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: db47e4797198ee601990820437179bb90219f918962318d494ada2b4b11e6f6d + url: "https://pub.dev" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4 + url: "https://pub.dev" source: hosted version: "1.1.0" strings: dependency: transitive description: name: strings - url: "https://pub.dartlang.org" + sha256: "5af86299505c299640f5564e187c1a2ee9d6308c540e8d65f6385f5c67019122" + url: "https://pub.dev" source: hosted version: "0.2.2" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + url: "https://pub.dev" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830 + url: "https://pub.dev" source: hosted version: "1.2.0" test: dependency: "direct dev" description: name: test - url: "https://pub.dartlang.org" + sha256: fd53f3bac5c70f26eec065456f73b20b11ea969aaa1099928bf9a6c1fd0e1403 + url: "https://pub.dev" source: hosted version: "1.20.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: d8ca35bbbeef2d037e5693a3c8a381505afebfbfee7bc33fff5581bc4e16a939 + url: "https://pub.dev" source: hosted version: "0.4.9" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: cc8bc45cbe52e8133293537ac4cffc4d9b35c93e91481eb64ef2304e2e722949 + url: "https://pub.dev" source: hosted version: "0.4.11" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + url: "https://pub.dev" source: hosted version: "1.0.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" unicode: dependency: transitive description: name: unicode - url: "https://pub.dartlang.org" + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" source: hosted version: "0.3.1" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: b5b99b53cb72c6e7461f86cf3201477bd4daca99ca8a636ffa0be7b967718909 + url: "https://pub.dev" source: hosted version: "8.1.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "0c2ada1b1aeb2ad031ca81872add6be049b8cb479262c6ad3c4b0f9c24eaab2f" + url: "https://pub.dev" source: hosted version: "2.1.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "5adb6ab8ed14e22bb907aae7338f0c206ea21e7a27004e97664b16c120306f00" + url: "https://pub.dev" source: hosted version: "1.0.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" + url: "https://pub.dev" source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0-100.0.dev <3.0.0" + dart: ">=2.16.0-100.0.dev <4.0.0" diff --git a/floor_ffi/pubspec.lock b/floor_ffi/pubspec.lock index eee60c1d..948ee9bf 100644 --- a/floor_ffi/pubspec.lock +++ b/floor_ffi/pubspec.lock @@ -5,14 +5,16 @@ packages: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762" + url: "https://pub.dev" source: hosted version: "1.15.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: d97fffd9d86f3dccc7a9059128b468a99320c69007cc9d41a3a1bda07d4e86dc + url: "https://pub.dev" source: hosted version: "1.0.0" floor_annotation: @@ -33,43 +35,49 @@ packages: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" + sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485" + url: "https://pub.dev" source: hosted version: "1.7.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + url: "https://pub.dev" source: hosted version: "1.8.0" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + sha256: "75e99c238f22152669c39e02a3cdcf78515d11856a8a78e0136452943404d9bd" + url: "https://pub.dev" source: hosted version: "2.0.1+1" sqflite_common_ffi: dependency: "direct main" description: name: sqflite_common_ffi - url: "https://pub.dartlang.org" + sha256: "29566b30e9bc81731e02dcf314437d9d9af8326f1a9f485cf8b510092287b75f" + url: "https://pub.dev" source: hosted version: "2.0.0+3" sqlite3: dependency: transitive description: name: sqlite3 - url: "https://pub.dartlang.org" + sha256: e41c802d493ab234cb4d1c8c51f8542f77192038a6f373b886346bad00ba4b84 + url: "https://pub.dev" source: hosted version: "1.0.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + url: "https://pub.dev" source: hosted version: "3.0.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.12.0 <4.0.0" diff --git a/floor_generator/pubspec.lock b/floor_generator/pubspec.lock index ad1cd597..37eaa17b 100644 --- a/floor_generator/pubspec.lock +++ b/floor_generator/pubspec.lock @@ -5,168 +5,192 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: "09d49759685f577cd71ec1fcf773afa3377e23d3a9137154a1a1d28dd5aaabd8" + url: "https://pub.dev" source: hosted version: "25.0.0" analyzer: dependency: "direct main" description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "21b3e7ffb8505789ecea7794480060b8e66dfa287dfa8923ff3735aadeb9cf29" + url: "https://pub.dev" source: hosted version: "2.2.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: ad180a697bf97dd54ab519a4665c57683bf4f70649a18671cea661cf0397c055 + url: "https://pub.dev" source: hosted version: "2.1.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "6eda8392a48ae1de7ea438c91a4ba3e77205f043e7013102a424863aa6db368f" + url: "https://pub.dev" source: hosted version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72" + url: "https://pub.dev" source: hosted version: "2.1.0" build: dependency: "direct main" description: name: build - url: "https://pub.dartlang.org" + sha256: ad0a562140603cf3dd77f0bdd068ffc11588661e3de7ba53c803e72382a1b3a2 + url: "https://pub.dev" source: hosted version: "2.1.0" build_config: dependency: "direct main" description: name: build_config - url: "https://pub.dartlang.org" + sha256: ad77deb6e9c143a3f550fbb4c5c1e0c6aadabe24274898d06b9526c61b9cf4fb + url: "https://pub.dev" source: hosted version: "1.0.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: a171129ff393d360a5ec9ba3a2277e0d7e713027709f08196e8192688b537074 + url: "https://pub.dev" source: hosted version: "2.0.4" build_test: dependency: "direct dev" description: name: build_test - url: "https://pub.dartlang.org" + sha256: "9cc3a6fa54e1ef225f70c06df1debff0688656b95c11b67f3b589578b419b67d" + url: "https://pub.dev" source: hosted version: "2.1.3" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: f5a2a975d3da1ca46579d2f173bea1c766f0044cff40889c8df8009bf6ea0d0c + url: "https://pub.dev" source: hosted version: "5.0.0" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "89dea36ea5480795cd8f3dd39d116f754fe39176fdf4d05984619cd6c3857735" + url: "https://pub.dev" source: hosted version: "8.0.5" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "9a462645329872f11cf4709edf4ae7b092bf60d3d6b6a072a39ab18311e04bb7" + url: "https://pub.dev" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: "8e36feea6de5ea69f2199f29cf42a450a855738c498b57c0b980e2d3cca9c362" + url: "https://pub.dev" source: hosted version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + url: "https://pub.dev" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: cf1c02840bbbcf8fcd13feb5933c62d643cc58ddf4f6088707cf48d1892cbc5d + url: "https://pub.dev" source: hosted version: "0.3.0" code_builder: dependency: "direct main" description: name: code_builder - url: "https://pub.dartlang.org" + sha256: bdb1ab29be158c4784d7f9b7b693745a0719c5899e31c01112782bb1cb871e80 + url: "https://pub.dev" source: hosted version: "4.1.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762" + url: "https://pub.dev" source: hosted version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: df567b950053d83b4dba3e8c5799c411895d146f82b2147114b666a4fd9a80dd + url: "https://pub.dev" source: hosted version: "3.0.0" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: "2890d8a09829de2cc3ead1407960549e4eb3c4e48c8fb837bfa5c68398496489" + url: "https://pub.dev" source: hosted version: "1.0.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: f857285c8dc0b4f2f77b49a1c083ff8c75223a7549de20f3e607df58cf497a43 + url: "https://pub.dev" source: hosted version: "0.17.0" dart_style: dependency: "direct dev" description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "4237f3f70a6b544cb31c9e90488ea7e61e1e50d72fe83ec34e8b2833698f7201" + url: "https://pub.dev" source: hosted version: "2.1.0" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "9fd2163d866769f60f4df8ac1dc59f52498d810c356fe78022e383dd3c57c0e1" + url: "https://pub.dev" source: hosted version: "6.1.0" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "6a2ef17156f4dc49684f9d99aaf4a93aba8ac49f5eac861755f5730ddf6e2e4e" + url: "https://pub.dev" source: hosted version: "1.0.0" floor_annotation: @@ -180,323 +204,369 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032" + url: "https://pub.dev" source: hosted version: "2.1.2" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: dda85ce2aefce16f7e75586acbcb1e8320bf176f69fd94082e31945d6de67f3e + url: "https://pub.dev" source: hosted version: "2.0.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: e07b56af3885387b0cbf6502d4ec17149189559de61256b97e195539afd1da0c + url: "https://pub.dev" source: hosted version: "2.0.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + url: "https://pub.dev" source: hosted version: "0.15.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 + url: "https://pub.dev" source: hosted version: "3.0.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "15a5436d2a02dc60e6dc2fb5d7dfaac08b7b137cff3d4bf3158d38ecab656b69" + url: "https://pub.dev" source: hosted version: "1.0.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: d9bdfd70d828eeb352390f81b18d6a354ef2044aa28ef25682079797fa7cd174 + url: "https://pub.dev" source: hosted version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: fd56fb29e3f02cd9bef80e99e9491d27889fb010f98ff3379b21e7d40d0112b3 + url: "https://pub.dev" source: hosted version: "4.0.1" lists: dependency: transitive description: name: lists - url: "https://pub.dartlang.org" + sha256: "15b788c949b642caf6ccc14ec07751318dc814fae802a7ca11e285a1920f4e10" + url: "https://pub.dev" source: hosted version: "1.0.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "0520a4826042a8a5d09ddd4755623a50d37ee536d79a70452aff8c8ad7bb6c27" + url: "https://pub.dev" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a" + url: "https://pub.dev" source: hosted version: "0.12.11" meta: dependency: "direct main" description: name: meta - url: "https://pub.dartlang.org" + sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485" + url: "https://pub.dev" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: a7a98ea7f366e2cc9d2b20873815aebec5e2bc124fe0da9d3f7f59b0625ea180 + url: "https://pub.dev" source: hosted version: "1.0.0" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: c133f761a6a790d0b000efa4f74eae9700bb6e9e9f5e996f0e8d6fe92703ced6 + url: "https://pub.dev" source: hosted version: "2.0.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "20e7154d701fedaeb219dad732815ecb66677667871127998a9a6581c2aba4ba" + url: "https://pub.dev" source: hosted version: "2.0.0" path: dependency: "direct dev" description: name: path - url: "https://pub.dartlang.org" + sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + url: "https://pub.dev" source: hosted version: "1.8.0" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "8f6460c77a98ad2807cd3b98c67096db4286f56166852d0ce5951bb600a63594" + url: "https://pub.dev" source: hosted version: "1.11.0" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" + url: "https://pub.dev" source: hosted version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "59ed538734419e81f7fc18c98249ae72c3c7188bdd9dceff2840585227f79843" + url: "https://pub.dev" source: hosted version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: "358c5ce09744e0e08b3f5f38c53d7d26a8219dd641718f8500f49cfa56240358" + url: "https://pub.dev" source: hosted version: "1.0.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: c2f658d28ec86857657dec3579e2db4dc5a6c477b6aecde870e77f0682258901 + url: "https://pub.dev" source: hosted version: "1.1.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: e0b44ebddec91e70a713e13adf93c1b2100821303b86a18e1ef1d082bd8bd9b8 + url: "https://pub.dev" source: hosted version: "3.0.0" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: "8584c0aa0f5756a61519b1a2fc2cd22ddbc518e9396bd33ebf06b9836bb23d13" + url: "https://pub.dev" source: hosted version: "1.0.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d + url: "https://pub.dev" source: hosted version: "1.0.1" source_gen: dependency: "direct main" description: name: source_gen - url: "https://pub.dartlang.org" + sha256: f6f2e0bd328c2ae57037a396c66248abe882f07440c5f41bb5e11e02977f8578 + url: "https://pub.dev" source: hosted version: "1.1.0" source_map_stack_trace: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" + url: "https://pub.dev" source: hosted version: "2.1.0" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" + url: "https://pub.dev" source: hosted version: "0.10.10" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: d5f89a9e52b36240a80282b3dc0667dd36e53459717bb17b8fb102d30496606a + url: "https://pub.dev" source: hosted version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774 + url: "https://pub.dev" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: db47e4797198ee601990820437179bb90219f918962318d494ada2b4b11e6f6d + url: "https://pub.dev" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4 + url: "https://pub.dev" source: hosted version: "1.1.0" strings: dependency: "direct main" description: name: strings - url: "https://pub.dartlang.org" + sha256: "5ba70ef2845f87438b4d038677b34822acfd9f3a70b7c339762acbb58d0c1fe0" + url: "https://pub.dev" source: hosted version: "0.2.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830 + url: "https://pub.dev" source: hosted version: "1.2.0" test: dependency: "direct dev" description: name: test - url: "https://pub.dartlang.org" + sha256: d8df85e0659006d6dd09dd5d1d4bf81848d34fbe5b1fdd2b2a90e690aaa8195e + url: "https://pub.dev" source: hosted version: "1.17.12" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "3c3c3eb64242eec8aeb7a7e530cd541737a84bb01fc08b363b429aaa4a91060d" + url: "https://pub.dev" source: hosted version: "0.4.3" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: f269e59fdd3abd14d6d92d3da9a03f69e931e9dd9140d6f06f94fc2204584741 + url: "https://pub.dev" source: hosted version: "0.4.2" test_cov: dependency: "direct dev" description: name: test_cov - url: "https://pub.dartlang.org" + sha256: cb2506e782a7e2dde427c6d46dbac221efb9e37f9191bc57e473b89f7756d68f + url: "https://pub.dev" source: hosted version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" unicode: dependency: transitive description: name: unicode - url: "https://pub.dartlang.org" + sha256: "0c90cf0f633aab2d2e3f53e2a61979abe667c30543aa7a9b9b09d4a52cc39fa7" + url: "https://pub.dev" source: hosted version: "0.3.0" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: "422eda09e2a50eb27fe9eca2c897d624cea7fa432a8442e1ea1a10d50a4321ab" + url: "https://pub.dev" source: hosted version: "6.2.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "68173f2fa67d241323a4123be7ed4e43424c54befa5505d71c8ad4b7baf8f71d" + url: "https://pub.dev" source: hosted version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "500e6014efebd305a30ebf1c6006d13faa82dcd85c7a2a7793679a64ed69ec48" + url: "https://pub.dev" source: hosted version: "2.0.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: "5adb6ab8ed14e22bb907aae7338f0c206ea21e7a27004e97664b16c120306f00" + url: "https://pub.dev" source: hosted version: "1.0.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" + url: "https://pub.dev" source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.12.0 <4.0.0" From 88f64b607c9c8db1d2c8fdc0009f705fb38ebe12 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Fri, 15 Mar 2024 10:13:42 +0100 Subject: [PATCH 03/22] Merge with develop, and delete database_factory_ext.dart that's no used in sqflite_database_factory.dart --- example/pubspec.lock | 15 ++- floor/pubspec.lock | 29 +++-- floor/pubspec.yaml | 2 +- floor_common/lib/floor_common.dart | 1 - .../lib/src/database_factory_ext.dart | 9 -- floor_common/pubspec.lock | 100 +++++++-------- floor_common/pubspec.yaml | 24 ++-- floor_ffi/pubspec.lock | 115 +++++++++++++++--- floor_ffi/pubspec.yaml | 8 +- 9 files changed, 195 insertions(+), 108 deletions(-) delete mode 100644 floor_common/lib/src/database_factory_ext.dart diff --git a/example/pubspec.lock b/example/pubspec.lock index ad812b07..424a36c2 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -223,6 +223,13 @@ packages: relative: true source: path version: "1.4.2" + floor_common: + dependency: transitive + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" floor_generator: dependency: "direct dev" description: @@ -489,10 +496,10 @@ packages: dependency: transitive 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: @@ -529,10 +536,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: diff --git a/floor/pubspec.lock b/floor/pubspec.lock index e7b7661a..470a2e02 100644 --- a/floor/pubspec.lock +++ b/floor/pubspec.lock @@ -216,6 +216,13 @@ packages: relative: true source: path version: "1.4.2" + floor_common: + dependency: "direct main" + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" floor_generator: dependency: "direct dev" description: @@ -301,26 +308,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: cdd14e3836065a1f6302a236ec8b5f700695c803c57ae11a1c84df31e6bcf831 + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "10.0.3" + version: "10.0.0" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9b2ef90589911d665277464e0482b209d39882dffaaf4ef69a3561a3354b2ebc" + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "2.0.1" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: fd3cd66cb2bcd7b50dcd3b413af49d78051f809c8b3f6e047962765c15a0d23d + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "2.0.1" lists: dependency: transitive description: @@ -554,10 +561,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.6.1" timing: dependency: transitive description: @@ -594,10 +601,10 @@ packages: dependency: transitive description: name: vm_service - sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "14.0.0" + version: "13.0.0" watcher: dependency: transitive description: @@ -624,4 +631,4 @@ packages: version: "3.1.1" sdks: dart: ">=3.2.6 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.7.0" diff --git a/floor/pubspec.yaml b/floor/pubspec.yaml index e40ebb44..d384651c 100644 --- a/floor/pubspec.yaml +++ b/floor/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: path: ^1.9.0 sqflite: ^2.3.2 sqflite_common_ffi: ^2.3.2+1 - sqlparser: ^0.34.0 + sqlparser: ^0.34.1 dev_dependencies: build_runner: ^2.4.8 diff --git a/floor_common/lib/floor_common.dart b/floor_common/lib/floor_common.dart index 762ec968..11b7e1fd 100644 --- a/floor_common/lib/floor_common.dart +++ b/floor_common/lib/floor_common.dart @@ -8,5 +8,4 @@ export 'package:floor_common/src/adapter/query_adapter.dart'; export 'package:floor_common/src/adapter/update_adapter.dart'; export 'package:floor_common/src/callback.dart'; export 'package:floor_common/src/database.dart'; -export 'package:floor_common/src/database_factory_ext.dart'; export 'package:floor_common/src/migration.dart'; diff --git a/floor_common/lib/src/database_factory_ext.dart b/floor_common/lib/src/database_factory_ext.dart deleted file mode 100644 index 8f50ac2b..00000000 --- a/floor_common/lib/src/database_factory_ext.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:path/path.dart'; -import 'package:sqflite_common/sqlite_api.dart'; - -extension DatabaseFactoryExtension on DatabaseFactory { - Future getDatabasePath(final String name) async { - final databasesPath = await this.getDatabasesPath(); - return join(databasesPath, name); - } -} diff --git a/floor_common/pubspec.lock b/floor_common/pubspec.lock index 382afc07..01a79e44 100644 --- a/floor_common/pubspec.lock +++ b/floor_common/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "67.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.4.1" args: dependency: transitive description: @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: async - sha256: db4766341bd8ecb66556f31ab891a5d596ef829221993531bd64a8e6342f0cda + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.1" build_config: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169" + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "4.0.0" build_resolvers: dependency: transitive description: @@ -77,10 +77,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "93f05c041932674be039b0a2323d6cf57e5f2bbf884a3c0382f9e53fc45ebace" + sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.8" build_runner_core: dependency: transitive description: @@ -181,10 +181,10 @@ packages: dependency: transitive description: name: ffi - sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.1.2" file: dependency: transitive description: @@ -224,10 +224,10 @@ packages: dependency: transitive description: name: frontend_server_client - sha256: "6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: @@ -240,10 +240,10 @@ packages: dependency: transitive description: name: graphs - sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.1" http_multi_server: dependency: transitive description: @@ -304,10 +304,10 @@ packages: dependency: "direct dev" description: name: matcher - sha256: "2e2c34e631f93410daa3ee3410250eadc77ac6befc02a040eda8a123f34e6f5a" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: @@ -336,10 +336,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: dd61809f04da1838a680926de50a9e87385c1de91c6579629c3d1723946e8059 + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.4" node_preamble: dependency: transitive description: @@ -352,18 +352,18 @@ packages: dependency: transitive description: name: package_config - sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: "direct main" description: name: path - sha256: "240ed0e9bd73daa2182e33c4efc68c7dd53c7c656f3da73515a2d163e151412d" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.0" pool: dependency: transitive description: @@ -376,10 +376,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: b5a5fcc6425ea43704852ba4453ba94b08c2226c63418a260240c3a054579014 + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" pubspec_parse: dependency: transitive description: @@ -461,42 +461,42 @@ packages: dependency: "direct main" description: name: sqflite - sha256: f83e4c46d693b02436348a3a8693fa0fa50b0d98eeb55afc7579b70b0d8967f6 + sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.3.2" sqflite_common: dependency: "direct main" description: name: sqflite_common - sha256: c65f003175e4d0559af8180000eec451479b1017bd6c7a7d446c9ae3fecbea0a + sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.5.3" sqflite_common_ffi: dependency: "direct dev" description: name: sqflite_common_ffi - sha256: "1756ff13ce9c078d977068954187d0efc1cd3d6d450f7147b2cae486acf01806" + sha256: "754927d82de369a6b9e760fb60640aa81da650f35ffd468d5a992814d6022908" url: "https://pub.dev" source: hosted - version: "2.1.0+2" + version: "2.3.2+1" sqlite3: dependency: transitive description: name: sqlite3 - sha256: "88009712a98743bd476111c03d8064aea7ae12650a66ca62f866e121c3380d90" + sha256: "072128763f1547e3e9b4735ce846bfd226d68019ccda54db4cd427b12dfdedc9" url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "2.4.0" sqlparser: dependency: "direct main" description: name: sqlparser - sha256: "91f47610aa54d8abf9d795a7b4e49b2a788f65d7493d5a68fbf180c3cbcc6f38" + sha256: "7b20045d1ccfb7bc1df7e8f9fee5ae58673fce6ff62cefbb0e0fd7214e90e5a0" url: "https://pub.dev" source: hosted - version: "0.27.0" + version: "0.34.1" stack_trace: dependency: transitive description: @@ -533,10 +533,10 @@ packages: dependency: transitive description: name: strings - sha256: "5af86299505c299640f5564e187c1a2ee9d6308c540e8d65f6385f5c67019122" + sha256: b33f40c4dd3e597bf6d9e7f4f4dc282dad0f19b07d9f320cb5c2183859cbccf5 url: "https://pub.dev" source: hosted - version: "0.2.2" + version: "3.1.1" synchronized: dependency: transitive description: @@ -557,26 +557,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "5301f54eb6fe945daa99bc8df6ece3f88b5ceaa6f996f250efdaaf63e22886be" + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.23.1" + version: "1.25.2" test_api: dependency: transitive description: name: test_api - sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.4.18" + version: "0.7.0" test_core: dependency: transitive description: name: test_core - sha256: d2e9240594b409565524802b84b7b39341da36dd6fd8e1660b53ad928ec3e9af + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" url: "https://pub.dev" source: hosted - version: "0.4.24" + version: "0.6.0" timing: dependency: transitive description: @@ -621,10 +621,10 @@ packages: dependency: transitive description: name: watcher - sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" web_socket_channel: dependency: transitive description: @@ -650,5 +650,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=3.2.0-0 <4.0.0" - flutter: ">=1.10.0" + dart: ">=3.3.0-279.1.beta <4.0.0" + flutter: ">=3.7.0" diff --git a/floor_common/pubspec.yaml b/floor_common/pubspec.yaml index 12dac1ee..7eedbcb0 100644 --- a/floor_common/pubspec.yaml +++ b/floor_common/pubspec.yaml @@ -7,23 +7,23 @@ homepage: https://floor.codes publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.2.6 <4.0.0' dependencies: floor_annotation: path: ../floor_annotation/ - meta: ^1.7.0 - path: ^1.8.0 - sqflite_common: ^2.0.1+1 - sqflite: ^2.0.0+4 - sqlparser: ^0.27.0 + meta: + path: ^1.9.0 + sqflite_common: ^2.5.3 + sqflite: ^2.3.2 + sqlparser: ^0.34.1 dev_dependencies: - build_runner: ^2.1.2 - collection: ^1.15.0 + build_runner: ^2.4.8 + collection: ^1.18.0 floor_generator: path: ../floor_generator/ - sqflite_common_ffi: ^2.0.0+3 - test: ^1.20.1 - matcher: ^0.12.10 - mockito: ^5.0.15 + sqflite_common_ffi: ^2.3.2+1 + test: ^1.25.2 + matcher: ^0.12.16+1 + mockito: ^5.4.4 diff --git a/floor_ffi/pubspec.lock b/floor_ffi/pubspec.lock index 948ee9bf..1ef82e41 100644 --- a/floor_ffi/pubspec.lock +++ b/floor_ffi/pubspec.lock @@ -1,29 +1,45 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" + source: hosted + version: "1.3.1" collection: dependency: transitive description: name: collection - sha256: "6d4193120997ecfd09acf0e313f13dc122b119e5eca87ef57a7d065ec9183762" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.18.0" ffi: dependency: transitive description: name: ffi - sha256: d97fffd9d86f3dccc7a9059128b468a99320c69007cc9d41a3a1bda07d4e86dc + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.1.2" floor_annotation: dependency: "direct main" description: path: "../floor_annotation" relative: true source: path - version: "1.0.1" + version: "1.4.2" floor_common: dependency: "direct main" description: @@ -31,46 +47,96 @@ packages: relative: true source: path version: "1.2.0" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" + source: hosted + version: "0.8.0" meta: dependency: "direct main" description: name: meta - sha256: "5202fdd37b4da5fd14a237ed0a01cad6c1efd4c99b5b5a0d3c9237f3728c9485" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.11.0" path: dependency: "direct main" description: name: path - sha256: "2ad4cddff7f5cc0e2d13069f2a3f7a73ca18f66abd6f5ecf215219cdb3638edb" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "2.3.2" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "75e99c238f22152669c39e02a3cdcf78515d11856a8a78e0136452943404d9bd" + sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" url: "https://pub.dev" source: hosted - version: "2.0.1+1" + version: "2.5.3" sqflite_common_ffi: dependency: "direct main" description: name: sqflite_common_ffi - sha256: "29566b30e9bc81731e02dcf314437d9d9af8326f1a9f485cf8b510092287b75f" + sha256: "754927d82de369a6b9e760fb60640aa81da650f35ffd468d5a992814d6022908" url: "https://pub.dev" source: hosted - version: "2.0.0+3" + version: "2.3.2+1" sqlite3: dependency: transitive description: name: sqlite3 - sha256: e41c802d493ab234cb4d1c8c51f8542f77192038a6f373b886346bad00ba4b84 + sha256: "072128763f1547e3e9b4735ce846bfd226d68019ccda54db4cd427b12dfdedc9" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "2.4.0" + sqlparser: + dependency: transitive + description: + name: sqlparser + sha256: "7b20045d1ccfb7bc1df7e8f9fee5ae58673fce6ff62cefbb0e0fd7214e90e5a0" + url: "https://pub.dev" + source: hosted + version: "0.34.1" synchronized: dependency: transitive description: @@ -79,5 +145,22 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" sdks: - dart: ">=2.12.0 <4.0.0" + dart: ">=3.3.0-279.1.beta <4.0.0" + flutter: ">=3.7.0" diff --git a/floor_ffi/pubspec.yaml b/floor_ffi/pubspec.yaml index a6084ba7..50d36991 100644 --- a/floor_ffi/pubspec.yaml +++ b/floor_ffi/pubspec.yaml @@ -7,13 +7,13 @@ homepage: https://floor.codes publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.2.6 <4.0.0' dependencies: floor_annotation: path: ../floor_annotation/ floor_common: path: ../floor_common/ - meta: ^1.7.0 - path: ^1.8.0 - sqflite_common_ffi: ^2.0.0+3 + meta: + path: ^1.9.0 + sqflite_common_ffi: ^2.3.2+1 From 805244ca480ebfe8e84ee0b4421c1b516f4ca26f Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 19 Mar 2024 15:52:14 +0100 Subject: [PATCH 04/22] Run test in floor_common --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb1c03a3..2dbf2814 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: - name: Run tests run: flutter test --coverage --coverage-path coverage/lcov.info - working-directory: floor + working-directory: floor_common - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 08821b3d73f91abc1203f96211dbb23b045acd9c Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Fri, 22 Mar 2024 11:20:58 +0100 Subject: [PATCH 05/22] Remove sqflite from floor_common, because it depends on Flutter --- floor/pubspec.lock | 7 + .../lib/src/adapter/query_adapter.dart | 2 +- floor_common/pubspec.lock | 221 ++++++++---------- floor_common/pubspec.yaml | 1 - 4 files changed, 105 insertions(+), 126 deletions(-) diff --git a/floor/pubspec.lock b/floor/pubspec.lock index fd264012..a65da32e 100644 --- a/floor/pubspec.lock +++ b/floor/pubspec.lock @@ -216,6 +216,13 @@ packages: relative: true source: path version: "1.4.2" + floor_common: + dependency: "direct main" + description: + path: "../floor_common" + relative: true + source: path + version: "1.2.0" floor_generator: dependency: "direct dev" description: diff --git a/floor_common/lib/src/adapter/query_adapter.dart b/floor_common/lib/src/adapter/query_adapter.dart index 2053df5b..34c2cf6d 100644 --- a/floor_common/lib/src/adapter/query_adapter.dart +++ b/floor_common/lib/src/adapter/query_adapter.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:sqflite_common/sqlite_api.dart'; import 'package:collection/collection.dart'; import 'package:floor_common/src/util/string_utils.dart'; -import 'package:sqflite/sqflite.dart'; + import 'package:sqlparser/sqlparser.dart'; import '../util/constants.dart'; diff --git a/floor_common/pubspec.lock b/floor_common/pubspec.lock index 01a79e44..d772245d 100644 --- a/floor_common/pubspec.lock +++ b/floor_common/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: args - sha256: "0bd9a99b6eb96f07af141f0eb53eace8983e8e5aa5de59777aca31684680ef22" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" async: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: @@ -61,18 +61,18 @@ packages: dependency: transitive description: name: build_daemon - sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.4.2" build_runner: dependency: "direct dev" description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: build_runner_core - sha256: f4d6244cc071ba842c296cb1c4ee1b31596b9f924300647ac7a1445493471a3f + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" url: "https://pub.dev" source: hosted - version: "7.2.3" + version: "7.3.0" built_collection: dependency: transitive description: @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: built_value - sha256: b6c9911b2d670376918d5b8779bc27e0e612a94ec3ff0343689e991d8d0a3b8a + sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e url: "https://pub.dev" source: hosted - version: "8.1.4" + version: "8.9.1" characters: dependency: transitive description: @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" code_builder: dependency: transitive description: @@ -149,34 +149,34 @@ packages: dependency: transitive description: name: convert - sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" coverage: dependency: transitive description: name: coverage - sha256: c0122af6b3548369d6b7830c7a140d85c9a988d8d29c4976aa9ce4de46b122ef + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.7.2" crypto: dependency: transitive description: name: crypto - sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" dart_style: dependency: transitive description: name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.6" ffi: dependency: transitive description: @@ -189,18 +189,18 @@ packages: dependency: transitive description: name: file - sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "7.0.0" fixnum: dependency: transitive description: name: fixnum - sha256: "6a2ef17156f4dc49684f9d99aaf4a93aba8ac49f5eac861755f5730ddf6e2e4e" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" floor_annotation: dependency: "direct main" description: @@ -215,11 +215,6 @@ packages: relative: true source: path version: "1.4.2" - flutter: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" frontend_server_client: dependency: transitive description: @@ -232,10 +227,10 @@ packages: dependency: transitive description: name: glob - sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.2" graphs: dependency: transitive description: @@ -248,34 +243,34 @@ packages: dependency: transitive description: name: http_multi_server - sha256: bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" io: dependency: transitive description: name: io - sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" js: dependency: transitive description: name: js - sha256: a5e201311cb08bf3912ebbe9a2be096e182d703f881136ec1e81a2338a9e120d + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" json_annotation: dependency: transitive description: @@ -296,10 +291,10 @@ packages: dependency: transitive description: name: logging - sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" matcher: dependency: "direct dev" description: @@ -308,14 +303,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" - url: "https://pub.dev" - source: hosted - version: "0.8.0" meta: dependency: "direct main" description: @@ -328,10 +315,10 @@ packages: dependency: transitive description: name: mime - sha256: fd5f81041e6a9fc9b9d7fa2cb8a01123f9f5d5d49136e06cb9dc7d33689529f4 + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.5" mockito: dependency: "direct dev" description: @@ -344,10 +331,10 @@ packages: dependency: transitive description: name: node_preamble - sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: @@ -368,10 +355,10 @@ packages: dependency: transitive description: name: pool - sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" pub_semver: dependency: transitive description: @@ -384,47 +371,42 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: "3686efe4a4613a4449b1a4ae08670aadbd3376f2e78d93e3f8f0919db02a7256" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.3" shelf: dependency: transitive description: name: shelf - sha256: c240984c924796e055e831a0a36db23be8cb04f170b26df572931ab36418421d + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - sha256: e0b44ebddec91e70a713e13adf93c1b2100821303b86a18e1ef1d082bd8bd9b8 + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - sha256: "4a0d12cd512aa4fc55fed5f6280f02ef183f47ba29b4b0dfd621b1c99b7e6361" + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" + version: "1.0.4" source_gen: dependency: transitive description: @@ -437,50 +419,42 @@ packages: dependency: transitive description: name: source_map_stack_trace - sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" source_maps: dependency: transitive description: name: source_maps - sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" url: "https://pub.dev" source: hosted - version: "0.10.10" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - sha256: d77dbb9d0b7469d91e42d352334b2b4bbd5cec4379542f1bdb630db368c4d9f6 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.8.2" - sqflite: - dependency: "direct main" - description: - name: sqflite - sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 - url: "https://pub.dev" - source: hosted - version: "2.3.2" + version: "1.10.0" sqflite_common: dependency: "direct main" description: name: sqflite_common - sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.4" sqflite_common_ffi: dependency: "direct dev" description: name: sqflite_common_ffi - sha256: "754927d82de369a6b9e760fb60640aa81da650f35ffd468d5a992814d6022908" + sha256: "4d6137c29e930d6e4a8ff373989dd9de7bac12e3bc87bce950f6e844e8ad3bb5" url: "https://pub.dev" source: hosted - version: "2.3.2+1" + version: "2.3.3" sqlite3: dependency: transitive description: @@ -501,34 +475,34 @@ packages: dependency: transitive description: name: stack_trace - sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: db47e4797198ee601990820437179bb90219f918962318d494ada2b4b11e6f6d + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4 + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" strings: dependency: transitive description: @@ -541,18 +515,18 @@ packages: dependency: transitive description: name: synchronized - sha256: "271977ff1e9e82ceefb4f08424b8839f577c1852e0726b5ce855311b46d3ef83" + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0+1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830 + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: "direct dev" description: @@ -581,18 +555,18 @@ packages: dependency: transitive description: name: timing - sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" unicode: dependency: transitive description: @@ -601,22 +575,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.1" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - sha256: b5b99b53cb72c6e7461f86cf3201477bd4daca99ca8a636ffa0be7b967718909 + sha256: e7d5ecd604e499358c5fe35ee828c0298a320d54455e791e9dcf73486bc8d9f0 url: "https://pub.dev" source: hosted - version: "8.1.0" + version: "14.1.0" watcher: dependency: transitive description: @@ -625,30 +591,37 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "0c2ada1b1aeb2ad031ca81872add6be049b8cb479262c6ad3c4b0f9c24eaab2f" + sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.4" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - sha256: "5adb6ab8ed14e22bb907aae7338f0c206ea21e7a27004e97664b16c120306f00" + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" yaml: dependency: transitive description: name: yaml - sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=3.3.0-279.1.beta <4.0.0" - flutter: ">=3.7.0" + dart: ">=3.3.0 <4.0.0" diff --git a/floor_common/pubspec.yaml b/floor_common/pubspec.yaml index 7eedbcb0..d4a78d8c 100644 --- a/floor_common/pubspec.yaml +++ b/floor_common/pubspec.yaml @@ -15,7 +15,6 @@ dependencies: meta: path: ^1.9.0 sqflite_common: ^2.5.3 - sqflite: ^2.3.2 sqlparser: ^0.34.1 dev_dependencies: From 056977d7ac976a7551af9a599033f7d9b9ea9fd9 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Fri, 22 Mar 2024 11:28:44 +0100 Subject: [PATCH 06/22] Add floor_common to the .sh scripts, and add the getDatabasePath to database_factory.dart --- .github/workflows/ci.yml | 2 +- floor_common/test/test_util/database_factory.dart | 8 ++++++++ tool/generate_test_database.sh | 2 +- tool/upgrade.sh | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dbf2814..06a71af8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: Run generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - working-directory: floor + working-directory: floor_common - name: Analyze run: flutter analyze diff --git a/floor_common/test/test_util/database_factory.dart b/floor_common/test/test_util/database_factory.dart index 431afd6a..7f4ee9c1 100644 --- a/floor_common/test/test_util/database_factory.dart +++ b/floor_common/test/test_util/database_factory.dart @@ -1,3 +1,4 @@ +import 'package:path/path.dart'; import 'package:sqflite_common/sqlite_api.dart'; import 'package:sqflite_common_ffi/sqflite_ffi.dart'; @@ -6,3 +7,10 @@ final DatabaseFactory sqfliteDatabaseFactory = () { sqfliteFfiInit(); return databaseFactoryFfi; }(); + +extension DatabaseFactoryExtension on DatabaseFactory { + Future getDatabasePath(final String name) async { + final databasesPath = await this.getDatabasesPath(); + return join(databasesPath, name); + } +} \ No newline at end of file diff --git a/tool/generate_test_database.sh b/tool/generate_test_database.sh index b79e978b..82efa5cb 100644 --- a/tool/generate_test_database.sh +++ b/tool/generate_test_database.sh @@ -1,4 +1,4 @@ #!/bin/bash -cd ../floor +cd ../floor_common flutter packages pub run build_runner build --delete-conflicting-outputs diff --git a/tool/upgrade.sh b/tool/upgrade.sh index 38e4ebb2..c9f9edd7 100644 --- a/tool/upgrade.sh +++ b/tool/upgrade.sh @@ -6,6 +6,10 @@ cd floor flutter packages pub upgrade cd .. +cd floor_common +flutter packages pub upgrade +cd .. + cd floor_annotation flutter packages pub upgrade cd .. From cbeb60374aa8bbd3ace849ca0eef8015de9880af Mon Sep 17 00:00:00 2001 From: Stephan Mantel Date: Mon, 25 Mar 2024 16:37:10 +0100 Subject: [PATCH 07/22] Update location of coverage file --- logo.png | Bin 0 -> 4668 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3fe89819735f453c0d952771b178b40e8b1b2a GIT binary patch literal 4668 zcmds5XH=8vwtf@HP%IQ-umJ%a#Djq7P(+%vz@U^tje-yr1r;!kASDpUpbUZvC?Xb` zL1Y}nh=ra63r!RWf(S?er9^rOAR&aiGoH2Xy7#WT&fl|6_>t`IZTs8%+0V0I65Lz} zD`eNoB7{~rIokb-5Eg!7k+k?La;T2iH*;A%<2&i$L>vZfbor#oF^{-M%2Z8;dFmdqBY zQ2Qf0-aW~fjdXF60f+v5KM}dE*_NDDsIKtVty?SB84LOOR+rVV)-Ko5(_J&o&MwT3 zwg(#Ders%GWN)C^_L?q*%8ZZJrJQ(w@9iz4;n%v1OI(``7~1(gd-t}swswVf1~DV& zlDIbJ7}{r|r>EJePo)BZVDd}t9FL<#SvhZma&F9wc7`?IbqXGMGyiGOQiT~;sfFA! z{#dE%>E*Q};KKvg=&4kWSDgnIRo^QwFK4ktJG$px4%{T4woGKm=_uyq<$bA5CLcdu z+WW^kdWqX=NxYuNy9uzg+(9OO4*a(k-d=c4SPfjP;quEQ`*MA59OxIG;;Mb|7OkWvuC0kz-{64CbtB zjKG60kH3WO4reb32QQm&OGCak2O6(q;-vA&X-DMj$fvU4jV>7*VboJ`h#Kgqs=cML_T6II#R%WA#hqJS@5R!CKblLs;_etz%POyH} zSXTvm_8G&TVOoNb_+j~)t$o|F=XdQDe_B;o6LGI!zvj84rP_(!mtLNpkK=rYKNND> zMl|;liB=O;5|MLbms#iAAB0ItaNXVAivrsp^HzP0Qa**a?w+2M;ldKuY)3#*x;s+r zORtKefeVmQK)|zS&+N&YqHpf<`%-gRi;(ny!LT|zw1>Z5Q4>Y|nV&`ZtGrymh*=Ea zr))vF36PB zSsYX`Rz93Xoo(l7IMw+*u@d&m5eq$)EzTd&Mh9sCp6)XZdf>jQsw&6psvC*4bh}%q zO~KhaqtZiw!1?BM)>Cpfi>Fb|c=99|z`7%J87LtHkTfhCxh8UkK z?ERURR0=qBsy26-3{twpUK}NdbyLImvWfA?TH^qdGSgtdUeAox)Ie^ITW`LZgSbM< zz(ENN4LjWtz_5U%b98lnz@j++$>w4rey|~f)$aD=h(6@x$qv_=Hez5U~xN(x}f%V zoccC_k0r-BbU+z_fmeq~WhGq7@SS+IM4z3Our^xGN;m;kol8s!gQeZ~J@PA0Y+1@i z){0r-pA)<*LhTuNwlvz%JJSAS*^iqq`0R{UK#tWlm)DsDbto}o%{5U=RG9 zPXX8$@EsH08>d1irWi<~=BZruMIDGd18*RW?j8dYUuPT$+xW;M$42HHx0AzBV8(`H zQN5UER=Jvgw>Ei}p6*RpwUJJg--Yn@grxNmd=7+1Y`M!>e(SkSX02hyI$}|RS;SP| z-@%f1LU?b8DYqhw%$I!u#}(w}<`xwhQgDYQ(bd^E+uj9s7VA-PhG1QXU=|Lo#KrsUDtS~g;R*=1g zakdo&=OmBn44l*TRks|n=F48iqZGm^kfKg9+k%3-4}&Tek+TQO&Kyftv!KVP$YN+w zhQJ6QCB_t-i~_1#2K*i2>+8#xZH82;s8M)#8uTkRQ*b8~&;_E0$2N#APk93Y;rAan zaI_XeIoi}am&Ec0V~;JcK?!S5da0&mTuvI3AwEQI#2no zGr~KJbD3i9W5(Whwg5)AQ_CrDUS<_5CV)FjWua&1vgXIfgC#e82X&{m=v zc3cBBjgA3Ahla$nqp_$fpyf|@V3mtL76YlVY zd&?+5*tK!q73Eyi^L)xH?mPwO48l%n;DE5zDh}F}hBu&H)rra+-JU2J6!N>81?6XB z0~Hw3**x)0^+4t3D@0Kh9mxl%aQ5HF`5J=02TYiZfDZ(oi6`D9n5 z6At1D%@_rzq{f!`|4U*_BBw{yEaZ4s`C0F8az3H$$Cl;_*Fzn2L#>PVhry4J4s-jj z&^5sGb5e4RnLA8OvI{_|v>Yydn@VR#z29wedCj(am6hfu*(&Ad@@YNT4D*OH&^IKT zPt_6Gf>t15=${@vduBvYItUHm#gK0ky)`v81rN(lLTAYF>Nz5fqBet?fXsG_W=lFd zI_M=;aSDis9d2W&LsYJ45$N$%IC;cd>s1`MW}DxeJGSxgWL^>Rwl00EwPJ~8#1lc* zGgL6NhfjTLlYoKd#e8nt^9l0z(b<5xheT3mVjFj(oMBMaLhlL)P{uiAUGir^!9oK` zq{zftCW3jKOwKlsm;$neBjVu*{ff}h*X54!ZjugaaYv604+EfeA7#;D7bm zk|f-Knwa26OxM{qZ-9V=GzzK6UL5gf1KR1tss%v1O;FG%bS$to643qvVjL~}qE2AY z=70;X^f#oFyUIbXgz3mSDI_#h)FWlZ6H6?1ToKh}4h;B>t2>Ec>U|JXRm&(-3hvr9 z*l2%1K!B~S?LP~Sd3N~2qG*nt?1RCg?dfm*{2MbO2HxEKUaD1)L*j$|z~e1Y<;Md9 z&BG@S0XJzQ`7h9+gmEMMzgvEbf*GzJ%^HiY3=I!=c6NRz4abVG@#w$FUQ8i}F8-)T zS)6HuF(8{mK|w)dE40re><oHa5T6nWO8NgsgpT7zJF9JXddsp;bN#9&BtaAcElO zVbS~%k#IhKr7Gy14Uld%5F@plItQwz0jzv{UbIKk;jrP8bCy>ZA;c0M9%uj-&jhV&8 z#s;dGyJJ_K^*4>>Q!QUCGpO7W`0)`BMBL`sv3`(J`nz7o+9cKKW(Dgr+PiL?hVb%M znHmIsD*de~XD3Ha+Imh`SJw+P7OKHAe7X+k5a!7*)}fGm;9I6(sDLvVltmGI&0m-q zR#}wCgq(w$_0mH3Qj(?Lbcbkhfm}IR!;_ND8NQa5W@Ky}8XD@L{s@Opt>5fbJOaKY zL^mPJV%>+OpOa&RzWg%JL!O?VmJm9ERY=neT<=pn;4U`|=?V@G=BHq%3(3@iyu6<% jxPRaOVf-J@QgoLj;i3gqRUF;s(9E$xfyW9z( literal 0 HcmV?d00001 From 234ccda60681601e71bfdf706b100e20e40b6db9 Mon Sep 17 00:00:00 2001 From: Stephan Mantel Date: Mon, 25 Mar 2024 16:37:27 +0100 Subject: [PATCH 08/22] Update location of coverage file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06a71af8..c7fa4ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} flags: floor - file: ./floor/coverage/lcov.info + file: ./floor_common/coverage/lcov.info example: runs-on: ubuntu-latest From 2d7b01f3e846fd08db9c1e1c7bd0a9df12f4059c Mon Sep 17 00:00:00 2001 From: Stephan Mantel Date: Mon, 25 Mar 2024 16:37:40 +0100 Subject: [PATCH 09/22] Revert "Update location of coverage file" This reverts commit cbeb60374aa8bbd3ace849ca0eef8015de9880af. --- logo.png | Bin 4668 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 logo.png diff --git a/logo.png b/logo.png deleted file mode 100644 index 0f3fe89819735f453c0d952771b178b40e8b1b2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4668 zcmds5XH=8vwtf@HP%IQ-umJ%a#Djq7P(+%vz@U^tje-yr1r;!kASDpUpbUZvC?Xb` zL1Y}nh=ra63r!RWf(S?er9^rOAR&aiGoH2Xy7#WT&fl|6_>t`IZTs8%+0V0I65Lz} zD`eNoB7{~rIokb-5Eg!7k+k?La;T2iH*;A%<2&i$L>vZfbor#oF^{-M%2Z8;dFmdqBY zQ2Qf0-aW~fjdXF60f+v5KM}dE*_NDDsIKtVty?SB84LOOR+rVV)-Ko5(_J&o&MwT3 zwg(#Ders%GWN)C^_L?q*%8ZZJrJQ(w@9iz4;n%v1OI(``7~1(gd-t}swswVf1~DV& zlDIbJ7}{r|r>EJePo)BZVDd}t9FL<#SvhZma&F9wc7`?IbqXGMGyiGOQiT~;sfFA! z{#dE%>E*Q};KKvg=&4kWSDgnIRo^QwFK4ktJG$px4%{T4woGKm=_uyq<$bA5CLcdu z+WW^kdWqX=NxYuNy9uzg+(9OO4*a(k-d=c4SPfjP;quEQ`*MA59OxIG;;Mb|7OkWvuC0kz-{64CbtB zjKG60kH3WO4reb32QQm&OGCak2O6(q;-vA&X-DMj$fvU4jV>7*VboJ`h#Kgqs=cML_T6II#R%WA#hqJS@5R!CKblLs;_etz%POyH} zSXTvm_8G&TVOoNb_+j~)t$o|F=XdQDe_B;o6LGI!zvj84rP_(!mtLNpkK=rYKNND> zMl|;liB=O;5|MLbms#iAAB0ItaNXVAivrsp^HzP0Qa**a?w+2M;ldKuY)3#*x;s+r zORtKefeVmQK)|zS&+N&YqHpf<`%-gRi;(ny!LT|zw1>Z5Q4>Y|nV&`ZtGrymh*=Ea zr))vF36PB zSsYX`Rz93Xoo(l7IMw+*u@d&m5eq$)EzTd&Mh9sCp6)XZdf>jQsw&6psvC*4bh}%q zO~KhaqtZiw!1?BM)>Cpfi>Fb|c=99|z`7%J87LtHkTfhCxh8UkK z?ERURR0=qBsy26-3{twpUK}NdbyLImvWfA?TH^qdGSgtdUeAox)Ie^ITW`LZgSbM< zz(ENN4LjWtz_5U%b98lnz@j++$>w4rey|~f)$aD=h(6@x$qv_=Hez5U~xN(x}f%V zoccC_k0r-BbU+z_fmeq~WhGq7@SS+IM4z3Our^xGN;m;kol8s!gQeZ~J@PA0Y+1@i z){0r-pA)<*LhTuNwlvz%JJSAS*^iqq`0R{UK#tWlm)DsDbto}o%{5U=RG9 zPXX8$@EsH08>d1irWi<~=BZruMIDGd18*RW?j8dYUuPT$+xW;M$42HHx0AzBV8(`H zQN5UER=Jvgw>Ei}p6*RpwUJJg--Yn@grxNmd=7+1Y`M!>e(SkSX02hyI$}|RS;SP| z-@%f1LU?b8DYqhw%$I!u#}(w}<`xwhQgDYQ(bd^E+uj9s7VA-PhG1QXU=|Lo#KrsUDtS~g;R*=1g zakdo&=OmBn44l*TRks|n=F48iqZGm^kfKg9+k%3-4}&Tek+TQO&Kyftv!KVP$YN+w zhQJ6QCB_t-i~_1#2K*i2>+8#xZH82;s8M)#8uTkRQ*b8~&;_E0$2N#APk93Y;rAan zaI_XeIoi}am&Ec0V~;JcK?!S5da0&mTuvI3AwEQI#2no zGr~KJbD3i9W5(Whwg5)AQ_CrDUS<_5CV)FjWua&1vgXIfgC#e82X&{m=v zc3cBBjgA3Ahla$nqp_$fpyf|@V3mtL76YlVY zd&?+5*tK!q73Eyi^L)xH?mPwO48l%n;DE5zDh}F}hBu&H)rra+-JU2J6!N>81?6XB z0~Hw3**x)0^+4t3D@0Kh9mxl%aQ5HF`5J=02TYiZfDZ(oi6`D9n5 z6At1D%@_rzq{f!`|4U*_BBw{yEaZ4s`C0F8az3H$$Cl;_*Fzn2L#>PVhry4J4s-jj z&^5sGb5e4RnLA8OvI{_|v>Yydn@VR#z29wedCj(am6hfu*(&Ad@@YNT4D*OH&^IKT zPt_6Gf>t15=${@vduBvYItUHm#gK0ky)`v81rN(lLTAYF>Nz5fqBet?fXsG_W=lFd zI_M=;aSDis9d2W&LsYJ45$N$%IC;cd>s1`MW}DxeJGSxgWL^>Rwl00EwPJ~8#1lc* zGgL6NhfjTLlYoKd#e8nt^9l0z(b<5xheT3mVjFj(oMBMaLhlL)P{uiAUGir^!9oK` zq{zftCW3jKOwKlsm;$neBjVu*{ff}h*X54!ZjugaaYv604+EfeA7#;D7bm zk|f-Knwa26OxM{qZ-9V=GzzK6UL5gf1KR1tss%v1O;FG%bS$to643qvVjL~}qE2AY z=70;X^f#oFyUIbXgz3mSDI_#h)FWlZ6H6?1ToKh}4h;B>t2>Ec>U|JXRm&(-3hvr9 z*l2%1K!B~S?LP~Sd3N~2qG*nt?1RCg?dfm*{2MbO2HxEKUaD1)L*j$|z~e1Y<;Md9 z&BG@S0XJzQ`7h9+gmEMMzgvEbf*GzJ%^HiY3=I!=c6NRz4abVG@#w$FUQ8i}F8-)T zS)6HuF(8{mK|w)dE40re><oHa5T6nWO8NgsgpT7zJF9JXddsp;bN#9&BtaAcElO zVbS~%k#IhKr7Gy14Uld%5F@plItQwz0jzv{UbIKk;jrP8bCy>ZA;c0M9%uj-&jhV&8 z#s;dGyJJ_K^*4>>Q!QUCGpO7W`0)`BMBL`sv3`(J`nz7o+9cKKW(Dgr+PiL?hVb%M znHmIsD*de~XD3Ha+Imh`SJw+P7OKHAe7X+k5a!7*)}fGm;9I6(sDLvVltmGI&0m-q zR#}wCgq(w$_0mH3Qj(?Lbcbkhfm}IR!;_ND8NQa5W@Ky}8XD@L{s@Opt>5fbJOaKY zL^mPJV%>+OpOa&RzWg%JL!O?VmJm9ERY=neT<=pn;4U`|=?V@G=BHq%3(3@iyu6<% jxPRaOVf-J@QgoLj;i3gqRUF;s(9E$xfyW9z( From 7e717f8491234257a8906ba5dc988e20323afc55 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Thu, 25 Apr 2024 11:08:46 +0200 Subject: [PATCH 10/22] merge with develop --- floor_ffi/pubspec.lock | 43 ------------------------------------------ 1 file changed, 43 deletions(-) diff --git a/floor_ffi/pubspec.lock b/floor_ffi/pubspec.lock index 1ef82e41..2afe3734 100644 --- a/floor_ffi/pubspec.lock +++ b/floor_ffi/pubspec.lock @@ -1,14 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" charcode: dependency: transitive description: @@ -47,11 +39,6 @@ packages: relative: true source: path version: "1.2.0" - flutter: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" js: dependency: transitive description: @@ -60,14 +47,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" - url: "https://pub.dev" - source: hosted - version: "0.8.0" meta: dependency: "direct main" description: @@ -84,11 +63,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" source_span: dependency: transitive description: @@ -97,14 +71,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" - sqflite: - dependency: transitive - description: - name: sqflite - sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 - url: "https://pub.dev" - source: hosted - version: "2.3.2" sqflite_common: dependency: transitive description: @@ -153,14 +119,5 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" sdks: dart: ">=3.3.0-279.1.beta <4.0.0" - flutter: ">=3.7.0" From 5dba82f2d9929814cf294a052bff292ec92036cc Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Thu, 25 Apr 2024 11:14:00 +0200 Subject: [PATCH 11/22] Add .g to the test folders --- .../autoincrement/autoinc_test.g.dart | 151 ++++++ .../test/integration/blob/blob_test.g.dart | 147 ++++++ .../boolean_conversions/bool_test.g.dart | 175 +++++++ floor_common/test/integration/database.g.dart | 447 ++++++++++++++++++ .../test/integration/fts/mail_database.g.dart | 212 +++++++++ .../inheritance/dao_inheritance_test.g.dart | 144 ++++++ .../entity_inheritance_test.g.dart | 170 +++++++ .../type_converter/order_database.g.dart | 166 +++++++ 8 files changed, 1612 insertions(+) create mode 100644 floor_common/test/integration/autoincrement/autoinc_test.g.dart create mode 100644 floor_common/test/integration/blob/blob_test.g.dart create mode 100644 floor_common/test/integration/boolean_conversions/bool_test.g.dart create mode 100644 floor_common/test/integration/database.g.dart create mode 100644 floor_common/test/integration/fts/mail_database.g.dart create mode 100644 floor_common/test/integration/inheritance/dao_inheritance_test.g.dart create mode 100644 floor_common/test/integration/inheritance/entity_inheritance_test.g.dart create mode 100644 floor_common/test/integration/type_converter/order_database.g.dart diff --git a/floor_common/test/integration/autoincrement/autoinc_test.g.dart b/floor_common/test/integration/autoincrement/autoinc_test.g.dart new file mode 100644 index 00000000..875cfb82 --- /dev/null +++ b/floor_common/test/integration/autoincrement/autoinc_test.g.dart @@ -0,0 +1,151 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'autoinc_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + AIDao? _aiDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `AutoIncEntity` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `decimal` REAL NOT NULL)'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + AIDao get aiDao { + return _aiDaoInstance ??= _$AIDao(database, changeListener); + } +} + +class _$AIDao extends AIDao { + _$AIDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _autoIncEntityInsertionAdapter = InsertionAdapter( + database, + 'AutoIncEntity', + (AutoIncEntity item) => + {'id': item.id, 'decimal': item.decimal}); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _autoIncEntityInsertionAdapter; + + @override + Future findWithId(int val) async { + return _queryAdapter.query('SELECT * FROM AutoIncEntity where id = ?1', + mapper: (Map row) => + AutoIncEntity(row['decimal'] as double, id: row['id'] as int?), + arguments: [val]); + } + + @override + Future> findAll() async { + return _queryAdapter.queryList('SELECT * FROM AutoIncEntity', + mapper: (Map row) => + AutoIncEntity(row['decimal'] as double, id: row['id'] as int?)); + } + + @override + Future insertAIEntity(AutoIncEntity e) async { + await _autoIncEntityInsertionAdapter.insert(e, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/blob/blob_test.g.dart b/floor_common/test/integration/blob/blob_test.g.dart new file mode 100644 index 00000000..54932cb0 --- /dev/null +++ b/floor_common/test/integration/blob/blob_test.g.dart @@ -0,0 +1,147 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'blob_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `picture` BLOB NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _personInsertionAdapter = InsertionAdapter( + database, + 'Person', + (Person item) => { + 'id': item.id, + 'name': item.name, + 'picture': item.picture + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + @override + Future findPersonByPicture(Uint8List picture) async { + return _queryAdapter.query('SELECT * FROM Person WHERE picture = ?1', + mapper: (Map row) => Person(row['id'] as int, + row['name'] as String, row['picture'] as Uint8List), + arguments: [picture]); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/boolean_conversions/bool_test.g.dart b/floor_common/test/integration/boolean_conversions/bool_test.g.dart new file mode 100644 index 00000000..d517c02f --- /dev/null +++ b/floor_common/test/integration/boolean_conversions/bool_test.g.dart @@ -0,0 +1,175 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'bool_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + BoolDao? _boolDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `BooleanClass` (`id` INTEGER, `nullable` INTEGER, `nonNullable` INTEGER NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + BoolDao get boolDao { + return _boolDaoInstance ??= _$BoolDao(database, changeListener); + } +} + +class _$BoolDao extends BoolDao { + _$BoolDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _booleanClassInsertionAdapter = InsertionAdapter( + database, + 'BooleanClass', + (BooleanClass item) => { + 'id': item.id == null ? null : (item.id! ? 1 : 0), + 'nullable': + item.nullable == null ? null : (item.nullable! ? 1 : 0), + 'nonNullable': item.nonNullable ? 1 : 0 + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _booleanClassInsertionAdapter; + + @override + Future findWithNonNullable(bool val) async { + return _queryAdapter.query( + 'SELECT * FROM BooleanClass where nonNullable = ?1', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0), + arguments: [val ? 1 : 0]); + } + + @override + Future findWithNullable(bool val) async { + return _queryAdapter.query('SELECT * FROM BooleanClass where nullable = ?1', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0), + arguments: [val ? 1 : 0]); + } + + @override + Future findWithNullableBeingNull() async { + return _queryAdapter.query( + 'SELECT * FROM BooleanClass where nullable IS NULL', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0)); + } + + @override + Future insertBoolC(BooleanClass person) async { + await _booleanClassInsertionAdapter.insert( + person, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/database.g.dart b/floor_common/test/integration/database.g.dart new file mode 100644 index 00000000..35f5f67f --- /dev/null +++ b/floor_common/test/integration/database.g.dart @@ -0,0 +1,447 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + DogDao? _dogDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 2, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } + + @override + DogDao get dogDao { + return _dogDaoInstance ??= _$DogDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _personInsertionAdapter = InsertionAdapter( + database, + 'person', + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personUpdateAdapter = UpdateAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personDeletionAdapter = DeletionAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + final UpdateAdapter _personUpdateAdapter; + + final DeletionAdapter _personDeletionAdapter; + + @override + Future> findAllPersons() async { + return _queryAdapter.queryList('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Stream> findAllPersonsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + queryableName: 'person', + isView: false); + } + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id]); + } + + @override + Stream findPersonByIdAsStream(int id) { + return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id], + queryableName: 'person', + isView: false); + } + + @override + Stream uniqueRecordsCountAsStream() { + return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', + mapper: (Map row) => row.values.first as int, + queryableName: 'person', + isView: false); + } + + @override + Future findPersonByIdAndName( + int id, + String name, + ) async { + return _queryAdapter.query( + 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id, name]); + } + + @override + Future> findPersonsWithIds(List ids) async { + const offset = 1; + final _sqliteVariablesForIds = + Iterable.generate(ids.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...ids]); + } + + @override + Future> findPersonsWithNames(List names) async { + const offset = 1; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...names]); + } + + @override + Future> findPersonsWithNamesComplex( + int reference, + List names, + List moreNames, + ) async { + int offset = 2; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + offset += names.length; + final _sqliteVariablesForMoreNames = + Iterable.generate(moreNames.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ') AND id>=?1 OR custom_name IN (' + + _sqliteVariablesForMoreNames + + ') AND id<=?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [reference, ...names, ...moreNames]); + } + + @override + Future> findPersonsWithNamesLike(String name) async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name LIKE ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [name]); + } + + @override + Future> findPersonsWithEmptyName() async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name == \'\'', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Future deleteAllPersons() async { + await _queryAdapter.queryNoReturn('DELETE FROM person'); + } + + @override + Stream> findAllDogsOfPersonAsStream(int id) { + return _queryAdapter.queryListStream( + 'SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id], + queryableName: 'dog', + isView: false); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); + } + + @override + Future insertPersons(List persons) async { + await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); + } + + @override + Future insertPersonWithReturn(Person person) { + return _personInsertionAdapter.insertAndReturnId( + person, OnConflictStrategy.abort); + } + + @override + Future> insertPersonsWithReturn(List persons) { + return _personInsertionAdapter.insertListAndReturnIds( + persons, OnConflictStrategy.abort); + } + + @override + Future updatePerson(Person person) async { + await _personUpdateAdapter.update(person, OnConflictStrategy.abort); + } + + @override + Future updatePersons(List persons) async { + await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); + } + + @override + Future updatePersonWithReturn(Person person) { + return _personUpdateAdapter.updateAndReturnChangedRows( + person, OnConflictStrategy.abort); + } + + @override + Future updatePersonsWithReturn(List persons) { + return _personUpdateAdapter.updateListAndReturnChangedRows( + persons, OnConflictStrategy.abort); + } + + @override + Future deletePerson(Person person) async { + await _personDeletionAdapter.delete(person); + } + + @override + Future deletePersons(List person) async { + await _personDeletionAdapter.deleteList(person); + } + + @override + Future deletePersonWithReturn(Person person) { + return _personDeletionAdapter.deleteAndReturnChangedRows(person); + } + + @override + Future deletePersonsWithReturn(List persons) { + return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); + } + + @override + Future replacePersons(List persons) async { + if (database is sqflite.Transaction) { + await super.replacePersons(persons); + } else { + await (database as sqflite.Database) + .transaction((transaction) async { + final transactionDatabase = _$TestDatabase(changeListener) + ..database = transaction; + await transactionDatabase.personDao.replacePersons(persons); + }); + } + } + + @override + Future> replacePersonsAndReturn(List persons) async { + if (database is sqflite.Transaction) { + return super.replacePersonsAndReturn(persons); + } else { + return (database as sqflite.Database) + .transaction>((transaction) async { + final transactionDatabase = _$TestDatabase(changeListener) + ..database = transaction; + return transactionDatabase.personDao.replacePersonsAndReturn(persons); + }); + } + } +} + +class _$DogDao extends DogDao { + _$DogDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _dogInsertionAdapter = InsertionAdapter( + database, + 'dog', + (Dog item) => { + 'id': item.id, + 'name': item.name, + 'nick_name': item.nickName, + 'owner_id': item.ownerId + }, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _dogInsertionAdapter; + + @override + Future findDogForPersonId(int id) async { + return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id]); + } + + @override + Future> findAllDogs() async { + return _queryAdapter.queryList('SELECT * FROM dog', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int)); + } + + @override + Future insertDog(Dog dog) async { + await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/fts/mail_database.g.dart b/floor_common/test/integration/fts/mail_database.g.dart new file mode 100644 index 00000000..bc803044 --- /dev/null +++ b/floor_common/test/integration/fts/mail_database.g.dart @@ -0,0 +1,212 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'mail_database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $MailDatabaseBuilderContract { + /// Adds migrations to the builder. + $MailDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $MailDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorMailDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $MailDatabaseBuilderContract databaseBuilder(String name) => + _$MailDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $MailDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$MailDatabaseBuilder(null); +} + +class _$MailDatabaseBuilder implements $MailDatabaseBuilderContract { + _$MailDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $MailDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $MailDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$MailDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$MailDatabase extends MailDatabase { + _$MailDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + MailDao? _mailDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE VIRTUAL TABLE IF NOT EXISTS `mail` USING fts4(`rowid` INTEGER NOT NULL, `text` TEXT NOT NULL, PRIMARY KEY (`rowid`), tokenize=unicode61 )'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + MailDao get mailDao { + return _mailDaoInstance ??= _$MailDao(database, changeListener); + } +} + +class _$MailDao extends MailDao { + _$MailDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _mailInsertionAdapter = InsertionAdapter( + database, + 'mail', + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener), + _mailUpdateAdapter = UpdateAdapter( + database, + 'mail', + ['rowid'], + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener), + _mailDeletionAdapter = DeletionAdapter( + database, + 'mail', + ['rowid'], + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _mailInsertionAdapter; + + final UpdateAdapter _mailUpdateAdapter; + + final DeletionAdapter _mailDeletionAdapter; + + @override + Future findMailById(int id) async { + return _queryAdapter.query('SELECT * FROM mail WHERE rowid = ?1', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + arguments: [id]); + } + + @override + Future> findMailByKey(String key) async { + return _queryAdapter.queryList('SELECT * FROM mail WHERE text match ?1', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + arguments: [key]); + } + + @override + Future> findAllMails() async { + return _queryAdapter.queryList('SELECT * FROM mail', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String)); + } + + @override + Stream> findAllMailsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM mail', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + queryableName: 'mail', + isView: false); + } + + @override + Future insertMail(Mail mailInfo) async { + await _mailInsertionAdapter.insert(mailInfo, OnConflictStrategy.abort); + } + + @override + Future insertMails(List mailInfo) async { + await _mailInsertionAdapter.insertList(mailInfo, OnConflictStrategy.abort); + } + + @override + Future updateMail(Mail mailInfo) async { + await _mailUpdateAdapter.update(mailInfo, OnConflictStrategy.abort); + } + + @override + Future updateMails(List mailInfo) async { + await _mailUpdateAdapter.updateList(mailInfo, OnConflictStrategy.abort); + } + + @override + Future deleteMail(Mail mailInfo) async { + await _mailDeletionAdapter.delete(mailInfo); + } + + @override + Future deleteMails(List mailInfo) async { + await _mailDeletionAdapter.deleteList(mailInfo); + } +} diff --git a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart new file mode 100644 index 00000000..58c86590 --- /dev/null +++ b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart @@ -0,0 +1,144 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'dao_inheritance_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _personInsertionAdapter = InsertionAdapter( + database, + 'Person', + (Person item) => + {'id': item.id, 'name': item.name}); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM Person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int, row['name'] as String), + arguments: [id]); + } + + @override + Future insertItem(Person item) async { + await _personInsertionAdapter.insert(item, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart new file mode 100644 index 00000000..2de28d1f --- /dev/null +++ b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart @@ -0,0 +1,170 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'entity_inheritance_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + CommentDao? _commentDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `comments` (`author` TEXT NOT NULL, `content` TEXT NOT NULL, `id` INTEGER NOT NULL, `create_time` TEXT NOT NULL, `update_time` TEXT, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + CommentDao get commentDao { + return _commentDaoInstance ??= _$CommentDao(database, changeListener); + } +} + +class _$CommentDao extends CommentDao { + _$CommentDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _commentInsertionAdapter = InsertionAdapter( + database, + 'comments', + (Comment item) => { + 'author': item.author, + 'content': item.content, + 'id': item.id, + 'create_time': item.createTime, + 'update_time': item.updateTime + }), + _commentDeletionAdapter = DeletionAdapter( + database, + 'comments', + ['id'], + (Comment item) => { + 'author': item.author, + 'content': item.content, + 'id': item.id, + 'create_time': item.createTime, + 'update_time': item.updateTime + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _commentInsertionAdapter; + + final DeletionAdapter _commentDeletionAdapter; + + @override + Future findCommentById(int id) async { + return _queryAdapter.query('SELECT * FROM comments WHERE id = ?1', + mapper: (Map row) => Comment( + row['id'] as int, row['author'] as String, + content: row['content'] as String, + createTime: row['create_time'] as String?, + updateTime: row['update_time'] as String?), + arguments: [id]); + } + + @override + Future addComment(Comment c) async { + await _commentInsertionAdapter.insert(c, OnConflictStrategy.abort); + } + + @override + Future removeComment(Comment c) async { + await _commentDeletionAdapter.delete(c); + } +} diff --git a/floor_common/test/integration/type_converter/order_database.g.dart b/floor_common/test/integration/type_converter/order_database.g.dart new file mode 100644 index 00000000..3746ee41 --- /dev/null +++ b/floor_common/test/integration/type_converter/order_database.g.dart @@ -0,0 +1,166 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'order_database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $OrderDatabaseBuilderContract { + /// Adds migrations to the builder. + $OrderDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $OrderDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorOrderDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $OrderDatabaseBuilderContract databaseBuilder(String name) => + _$OrderDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $OrderDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$OrderDatabaseBuilder(null); +} + +class _$OrderDatabaseBuilder implements $OrderDatabaseBuilderContract { + _$OrderDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $OrderDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $OrderDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$OrderDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$OrderDatabase extends OrderDatabase { + _$OrderDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + OrderDao? _orderDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Order` (`id` INTEGER NOT NULL, `date` INTEGER NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + OrderDao get orderDao { + return _orderDaoInstance ??= _$OrderDao(database, changeListener); + } +} + +class _$OrderDao extends OrderDao { + _$OrderDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _orderInsertionAdapter = InsertionAdapter( + database, + 'Order', + (Order item) => { + 'id': item.id, + 'date': _dateTimeConverter.encode(item.date) + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _orderInsertionAdapter; + + @override + Future> findOrdersByDate(DateTime date) async { + return _queryAdapter.queryList('SELECT * FROM `Order` WHERE date = ?1', + mapper: (Map row) => Order( + row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), + arguments: [_dateTimeConverter.encode(date)]); + } + + @override + Future> findOrdersByDates(List dates) async { + const offset = 1; + final _sqliteVariablesForDates = + Iterable.generate(dates.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM `Order` WHERE date IN (' + + _sqliteVariablesForDates + + ')', + mapper: (Map row) => Order( + row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), + arguments: [ + ...dates.map((element) => _dateTimeConverter.encode(element)) + ]); + } + + @override + Future insertOrder(Order order) async { + await _orderInsertionAdapter.insert(order, OnConflictStrategy.abort); + } +} + +// ignore_for_file: unused_element +final _dateTimeConverter = DateTimeConverter(); From 7f825c93d6efbc32e834fca81618d37a35f9c233 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Thu, 25 Apr 2024 11:14:33 +0200 Subject: [PATCH 12/22] Add .g to the test folders --- .../test/integration/view/view_test.g.dart | 521 ++++++++++++++++++ 1 file changed, 521 insertions(+) create mode 100644 floor_common/test/integration/view/view_test.g.dart diff --git a/floor_common/test/integration/view/view_test.g.dart b/floor_common/test/integration/view/view_test.g.dart new file mode 100644 index 00000000..b168d05e --- /dev/null +++ b/floor_common/test/integration/view/view_test.g.dart @@ -0,0 +1,521 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'view_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $ViewTestDatabaseBuilderContract { + /// Adds migrations to the builder. + $ViewTestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $ViewTestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorViewTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $ViewTestDatabaseBuilderContract databaseBuilder(String name) => + _$ViewTestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $ViewTestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$ViewTestDatabaseBuilder(null); +} + +class _$ViewTestDatabaseBuilder implements $ViewTestDatabaseBuilderContract { + _$ViewTestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $ViewTestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $ViewTestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$ViewTestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$ViewTestDatabase extends ViewTestDatabase { + _$ViewTestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + DogDao? _dogDaoInstance; + + NameDao? _nameDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); + await database.execute( + 'CREATE VIEW IF NOT EXISTS `names` AS SELECT custom_name as name FROM person UNION SELECT name from dog'); + await database.execute( + 'CREATE VIEW IF NOT EXISTS `multiline_query_names` AS SELECT custom_name as name \n FROM person \n UNION SELECT name from dog\n '); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } + + @override + DogDao get dogDao { + return _dogDaoInstance ??= _$DogDao(database, changeListener); + } + + @override + NameDao get nameDao { + return _nameDaoInstance ??= _$NameDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _personInsertionAdapter = InsertionAdapter( + database, + 'person', + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personUpdateAdapter = UpdateAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personDeletionAdapter = DeletionAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + final UpdateAdapter _personUpdateAdapter; + + final DeletionAdapter _personDeletionAdapter; + + @override + Future> findAllPersons() async { + return _queryAdapter.queryList('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Stream> findAllPersonsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + queryableName: 'person', + isView: false); + } + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id]); + } + + @override + Stream findPersonByIdAsStream(int id) { + return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id], + queryableName: 'person', + isView: false); + } + + @override + Stream uniqueRecordsCountAsStream() { + return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', + mapper: (Map row) => row.values.first as int, + queryableName: 'person', + isView: false); + } + + @override + Future findPersonByIdAndName( + int id, + String name, + ) async { + return _queryAdapter.query( + 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id, name]); + } + + @override + Future> findPersonsWithIds(List ids) async { + const offset = 1; + final _sqliteVariablesForIds = + Iterable.generate(ids.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...ids]); + } + + @override + Future> findPersonsWithNames(List names) async { + const offset = 1; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...names]); + } + + @override + Future> findPersonsWithNamesComplex( + int reference, + List names, + List moreNames, + ) async { + int offset = 2; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + offset += names.length; + final _sqliteVariablesForMoreNames = + Iterable.generate(moreNames.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ') AND id>=?1 OR custom_name IN (' + + _sqliteVariablesForMoreNames + + ') AND id<=?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [reference, ...names, ...moreNames]); + } + + @override + Future> findPersonsWithNamesLike(String name) async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name LIKE ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [name]); + } + + @override + Future> findPersonsWithEmptyName() async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name == \'\'', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Future deleteAllPersons() async { + await _queryAdapter.queryNoReturn('DELETE FROM person'); + } + + @override + Stream> findAllDogsOfPersonAsStream(int id) { + return _queryAdapter.queryListStream( + 'SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id], + queryableName: 'dog', + isView: false); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); + } + + @override + Future insertPersons(List persons) async { + await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); + } + + @override + Future insertPersonWithReturn(Person person) { + return _personInsertionAdapter.insertAndReturnId( + person, OnConflictStrategy.abort); + } + + @override + Future> insertPersonsWithReturn(List persons) { + return _personInsertionAdapter.insertListAndReturnIds( + persons, OnConflictStrategy.abort); + } + + @override + Future updatePerson(Person person) async { + await _personUpdateAdapter.update(person, OnConflictStrategy.abort); + } + + @override + Future updatePersons(List persons) async { + await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); + } + + @override + Future updatePersonWithReturn(Person person) { + return _personUpdateAdapter.updateAndReturnChangedRows( + person, OnConflictStrategy.abort); + } + + @override + Future updatePersonsWithReturn(List persons) { + return _personUpdateAdapter.updateListAndReturnChangedRows( + persons, OnConflictStrategy.abort); + } + + @override + Future deletePerson(Person person) async { + await _personDeletionAdapter.delete(person); + } + + @override + Future deletePersons(List person) async { + await _personDeletionAdapter.deleteList(person); + } + + @override + Future deletePersonWithReturn(Person person) { + return _personDeletionAdapter.deleteAndReturnChangedRows(person); + } + + @override + Future deletePersonsWithReturn(List persons) { + return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); + } + + @override + Future replacePersons(List persons) async { + if (database is sqflite.Transaction) { + await super.replacePersons(persons); + } else { + await (database as sqflite.Database) + .transaction((transaction) async { + final transactionDatabase = _$ViewTestDatabase(changeListener) + ..database = transaction; + await transactionDatabase.personDao.replacePersons(persons); + }); + } + } + + @override + Future> replacePersonsAndReturn(List persons) async { + if (database is sqflite.Transaction) { + return super.replacePersonsAndReturn(persons); + } else { + return (database as sqflite.Database) + .transaction>((transaction) async { + final transactionDatabase = _$ViewTestDatabase(changeListener) + ..database = transaction; + return transactionDatabase.personDao.replacePersonsAndReturn(persons); + }); + } + } +} + +class _$DogDao extends DogDao { + _$DogDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _dogInsertionAdapter = InsertionAdapter( + database, + 'dog', + (Dog item) => { + 'id': item.id, + 'name': item.name, + 'nick_name': item.nickName, + 'owner_id': item.ownerId + }, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _dogInsertionAdapter; + + @override + Future findDogForPersonId(int id) async { + return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id]); + } + + @override + Future> findAllDogs() async { + return _queryAdapter.queryList('SELECT * FROM dog', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int)); + } + + @override + Future insertDog(Dog dog) async { + await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); + } +} + +class _$NameDao extends NameDao { + _$NameDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + @override + Future> findAllNames() async { + return _queryAdapter.queryList('SELECT * FROM names ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String)); + } + + @override + Stream> findAllNamesAsStream() { + return _queryAdapter.queryListStream( + 'SELECT * FROM names ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + queryableName: 'names', + isView: true); + } + + @override + Future findExactName(String name) async { + return _queryAdapter.query('SELECT * FROM names WHERE name = ?1', + mapper: (Map row) => Name(row['name'] as String), + arguments: [name]); + } + + @override + Future> findNamesLike(String suffix) async { + return _queryAdapter.queryList( + 'SELECT * FROM names WHERE name LIKE ?1 ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + arguments: [suffix]); + } + + @override + Future> findNamesMatchingBoth( + String prefix, + String suffix, + ) async { + return _queryAdapter.queryList( + 'SELECT * FROM names WHERE name LIKE ?2 AND name LIKE ?1 ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + arguments: [prefix, suffix]); + } + + @override + Future findMultilineQueryName(String name) async { + return _queryAdapter.query( + 'SELECT * FROM multiline_query_names WHERE name = ?1', + mapper: (Map row) => + MultilineQueryName(row['name'] as String), + arguments: [name]); + } +} From 0ed865f382f0d0e6530dcfa502dfa4b02673a251 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Thu, 25 Apr 2024 13:00:19 +0200 Subject: [PATCH 13/22] delete .g files and update gitignore --- .gitignore | 2 +- .../autoincrement/autoinc_test.g.dart | 151 ----- .../test/integration/blob/blob_test.g.dart | 147 ----- .../boolean_conversions/bool_test.g.dart | 175 ------ floor_common/test/integration/database.g.dart | 447 --------------- .../test/integration/fts/mail_database.g.dart | 212 ------- .../inheritance/dao_inheritance_test.g.dart | 144 ----- .../entity_inheritance_test.g.dart | 170 ------ .../type_converter/order_database.g.dart | 166 ------ .../test/integration/view/view_test.g.dart | 521 ------------------ 10 files changed, 1 insertion(+), 2134 deletions(-) delete mode 100644 floor_common/test/integration/autoincrement/autoinc_test.g.dart delete mode 100644 floor_common/test/integration/blob/blob_test.g.dart delete mode 100644 floor_common/test/integration/boolean_conversions/bool_test.g.dart delete mode 100644 floor_common/test/integration/database.g.dart delete mode 100644 floor_common/test/integration/fts/mail_database.g.dart delete mode 100644 floor_common/test/integration/inheritance/dao_inheritance_test.g.dart delete mode 100644 floor_common/test/integration/inheritance/entity_inheritance_test.g.dart delete mode 100644 floor_common/test/integration/type_converter/order_database.g.dart delete mode 100644 floor_common/test/integration/view/view_test.g.dart diff --git a/.gitignore b/.gitignore index 3406c8e2..10d6e236 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Miscellaneous -floor/**/*.g.dart +floor_common/**/*.g.dart *.class *.log *.pyc diff --git a/floor_common/test/integration/autoincrement/autoinc_test.g.dart b/floor_common/test/integration/autoincrement/autoinc_test.g.dart deleted file mode 100644 index 875cfb82..00000000 --- a/floor_common/test/integration/autoincrement/autoinc_test.g.dart +++ /dev/null @@ -1,151 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'autoinc_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - AIDao? _aiDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `AutoIncEntity` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `decimal` REAL NOT NULL)'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - AIDao get aiDao { - return _aiDaoInstance ??= _$AIDao(database, changeListener); - } -} - -class _$AIDao extends AIDao { - _$AIDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _autoIncEntityInsertionAdapter = InsertionAdapter( - database, - 'AutoIncEntity', - (AutoIncEntity item) => - {'id': item.id, 'decimal': item.decimal}); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _autoIncEntityInsertionAdapter; - - @override - Future findWithId(int val) async { - return _queryAdapter.query('SELECT * FROM AutoIncEntity where id = ?1', - mapper: (Map row) => - AutoIncEntity(row['decimal'] as double, id: row['id'] as int?), - arguments: [val]); - } - - @override - Future> findAll() async { - return _queryAdapter.queryList('SELECT * FROM AutoIncEntity', - mapper: (Map row) => - AutoIncEntity(row['decimal'] as double, id: row['id'] as int?)); - } - - @override - Future insertAIEntity(AutoIncEntity e) async { - await _autoIncEntityInsertionAdapter.insert(e, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/blob/blob_test.g.dart b/floor_common/test/integration/blob/blob_test.g.dart deleted file mode 100644 index 54932cb0..00000000 --- a/floor_common/test/integration/blob/blob_test.g.dart +++ /dev/null @@ -1,147 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'blob_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `picture` BLOB NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _personInsertionAdapter = InsertionAdapter( - database, - 'Person', - (Person item) => { - 'id': item.id, - 'name': item.name, - 'picture': item.picture - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - @override - Future findPersonByPicture(Uint8List picture) async { - return _queryAdapter.query('SELECT * FROM Person WHERE picture = ?1', - mapper: (Map row) => Person(row['id'] as int, - row['name'] as String, row['picture'] as Uint8List), - arguments: [picture]); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/boolean_conversions/bool_test.g.dart b/floor_common/test/integration/boolean_conversions/bool_test.g.dart deleted file mode 100644 index d517c02f..00000000 --- a/floor_common/test/integration/boolean_conversions/bool_test.g.dart +++ /dev/null @@ -1,175 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'bool_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - BoolDao? _boolDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `BooleanClass` (`id` INTEGER, `nullable` INTEGER, `nonNullable` INTEGER NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - BoolDao get boolDao { - return _boolDaoInstance ??= _$BoolDao(database, changeListener); - } -} - -class _$BoolDao extends BoolDao { - _$BoolDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _booleanClassInsertionAdapter = InsertionAdapter( - database, - 'BooleanClass', - (BooleanClass item) => { - 'id': item.id == null ? null : (item.id! ? 1 : 0), - 'nullable': - item.nullable == null ? null : (item.nullable! ? 1 : 0), - 'nonNullable': item.nonNullable ? 1 : 0 - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _booleanClassInsertionAdapter; - - @override - Future findWithNonNullable(bool val) async { - return _queryAdapter.query( - 'SELECT * FROM BooleanClass where nonNullable = ?1', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0), - arguments: [val ? 1 : 0]); - } - - @override - Future findWithNullable(bool val) async { - return _queryAdapter.query('SELECT * FROM BooleanClass where nullable = ?1', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0), - arguments: [val ? 1 : 0]); - } - - @override - Future findWithNullableBeingNull() async { - return _queryAdapter.query( - 'SELECT * FROM BooleanClass where nullable IS NULL', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0)); - } - - @override - Future insertBoolC(BooleanClass person) async { - await _booleanClassInsertionAdapter.insert( - person, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/database.g.dart b/floor_common/test/integration/database.g.dart deleted file mode 100644 index 35f5f67f..00000000 --- a/floor_common/test/integration/database.g.dart +++ /dev/null @@ -1,447 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - DogDao? _dogDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 2, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } - - @override - DogDao get dogDao { - return _dogDaoInstance ??= _$DogDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _personInsertionAdapter = InsertionAdapter( - database, - 'person', - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personUpdateAdapter = UpdateAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personDeletionAdapter = DeletionAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - final UpdateAdapter _personUpdateAdapter; - - final DeletionAdapter _personDeletionAdapter; - - @override - Future> findAllPersons() async { - return _queryAdapter.queryList('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Stream> findAllPersonsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - queryableName: 'person', - isView: false); - } - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id]); - } - - @override - Stream findPersonByIdAsStream(int id) { - return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id], - queryableName: 'person', - isView: false); - } - - @override - Stream uniqueRecordsCountAsStream() { - return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', - mapper: (Map row) => row.values.first as int, - queryableName: 'person', - isView: false); - } - - @override - Future findPersonByIdAndName( - int id, - String name, - ) async { - return _queryAdapter.query( - 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id, name]); - } - - @override - Future> findPersonsWithIds(List ids) async { - const offset = 1; - final _sqliteVariablesForIds = - Iterable.generate(ids.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...ids]); - } - - @override - Future> findPersonsWithNames(List names) async { - const offset = 1; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...names]); - } - - @override - Future> findPersonsWithNamesComplex( - int reference, - List names, - List moreNames, - ) async { - int offset = 2; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - offset += names.length; - final _sqliteVariablesForMoreNames = - Iterable.generate(moreNames.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ') AND id>=?1 OR custom_name IN (' + - _sqliteVariablesForMoreNames + - ') AND id<=?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [reference, ...names, ...moreNames]); - } - - @override - Future> findPersonsWithNamesLike(String name) async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name LIKE ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [name]); - } - - @override - Future> findPersonsWithEmptyName() async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name == \'\'', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Future deleteAllPersons() async { - await _queryAdapter.queryNoReturn('DELETE FROM person'); - } - - @override - Stream> findAllDogsOfPersonAsStream(int id) { - return _queryAdapter.queryListStream( - 'SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id], - queryableName: 'dog', - isView: false); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); - } - - @override - Future insertPersons(List persons) async { - await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); - } - - @override - Future insertPersonWithReturn(Person person) { - return _personInsertionAdapter.insertAndReturnId( - person, OnConflictStrategy.abort); - } - - @override - Future> insertPersonsWithReturn(List persons) { - return _personInsertionAdapter.insertListAndReturnIds( - persons, OnConflictStrategy.abort); - } - - @override - Future updatePerson(Person person) async { - await _personUpdateAdapter.update(person, OnConflictStrategy.abort); - } - - @override - Future updatePersons(List persons) async { - await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); - } - - @override - Future updatePersonWithReturn(Person person) { - return _personUpdateAdapter.updateAndReturnChangedRows( - person, OnConflictStrategy.abort); - } - - @override - Future updatePersonsWithReturn(List persons) { - return _personUpdateAdapter.updateListAndReturnChangedRows( - persons, OnConflictStrategy.abort); - } - - @override - Future deletePerson(Person person) async { - await _personDeletionAdapter.delete(person); - } - - @override - Future deletePersons(List person) async { - await _personDeletionAdapter.deleteList(person); - } - - @override - Future deletePersonWithReturn(Person person) { - return _personDeletionAdapter.deleteAndReturnChangedRows(person); - } - - @override - Future deletePersonsWithReturn(List persons) { - return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); - } - - @override - Future replacePersons(List persons) async { - if (database is sqflite.Transaction) { - await super.replacePersons(persons); - } else { - await (database as sqflite.Database) - .transaction((transaction) async { - final transactionDatabase = _$TestDatabase(changeListener) - ..database = transaction; - await transactionDatabase.personDao.replacePersons(persons); - }); - } - } - - @override - Future> replacePersonsAndReturn(List persons) async { - if (database is sqflite.Transaction) { - return super.replacePersonsAndReturn(persons); - } else { - return (database as sqflite.Database) - .transaction>((transaction) async { - final transactionDatabase = _$TestDatabase(changeListener) - ..database = transaction; - return transactionDatabase.personDao.replacePersonsAndReturn(persons); - }); - } - } -} - -class _$DogDao extends DogDao { - _$DogDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _dogInsertionAdapter = InsertionAdapter( - database, - 'dog', - (Dog item) => { - 'id': item.id, - 'name': item.name, - 'nick_name': item.nickName, - 'owner_id': item.ownerId - }, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _dogInsertionAdapter; - - @override - Future findDogForPersonId(int id) async { - return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id]); - } - - @override - Future> findAllDogs() async { - return _queryAdapter.queryList('SELECT * FROM dog', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int)); - } - - @override - Future insertDog(Dog dog) async { - await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/fts/mail_database.g.dart b/floor_common/test/integration/fts/mail_database.g.dart deleted file mode 100644 index bc803044..00000000 --- a/floor_common/test/integration/fts/mail_database.g.dart +++ /dev/null @@ -1,212 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mail_database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $MailDatabaseBuilderContract { - /// Adds migrations to the builder. - $MailDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $MailDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorMailDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $MailDatabaseBuilderContract databaseBuilder(String name) => - _$MailDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $MailDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$MailDatabaseBuilder(null); -} - -class _$MailDatabaseBuilder implements $MailDatabaseBuilderContract { - _$MailDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $MailDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $MailDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$MailDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$MailDatabase extends MailDatabase { - _$MailDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - MailDao? _mailDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE VIRTUAL TABLE IF NOT EXISTS `mail` USING fts4(`rowid` INTEGER NOT NULL, `text` TEXT NOT NULL, PRIMARY KEY (`rowid`), tokenize=unicode61 )'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - MailDao get mailDao { - return _mailDaoInstance ??= _$MailDao(database, changeListener); - } -} - -class _$MailDao extends MailDao { - _$MailDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _mailInsertionAdapter = InsertionAdapter( - database, - 'mail', - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener), - _mailUpdateAdapter = UpdateAdapter( - database, - 'mail', - ['rowid'], - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener), - _mailDeletionAdapter = DeletionAdapter( - database, - 'mail', - ['rowid'], - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _mailInsertionAdapter; - - final UpdateAdapter _mailUpdateAdapter; - - final DeletionAdapter _mailDeletionAdapter; - - @override - Future findMailById(int id) async { - return _queryAdapter.query('SELECT * FROM mail WHERE rowid = ?1', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - arguments: [id]); - } - - @override - Future> findMailByKey(String key) async { - return _queryAdapter.queryList('SELECT * FROM mail WHERE text match ?1', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - arguments: [key]); - } - - @override - Future> findAllMails() async { - return _queryAdapter.queryList('SELECT * FROM mail', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String)); - } - - @override - Stream> findAllMailsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM mail', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - queryableName: 'mail', - isView: false); - } - - @override - Future insertMail(Mail mailInfo) async { - await _mailInsertionAdapter.insert(mailInfo, OnConflictStrategy.abort); - } - - @override - Future insertMails(List mailInfo) async { - await _mailInsertionAdapter.insertList(mailInfo, OnConflictStrategy.abort); - } - - @override - Future updateMail(Mail mailInfo) async { - await _mailUpdateAdapter.update(mailInfo, OnConflictStrategy.abort); - } - - @override - Future updateMails(List mailInfo) async { - await _mailUpdateAdapter.updateList(mailInfo, OnConflictStrategy.abort); - } - - @override - Future deleteMail(Mail mailInfo) async { - await _mailDeletionAdapter.delete(mailInfo); - } - - @override - Future deleteMails(List mailInfo) async { - await _mailDeletionAdapter.deleteList(mailInfo); - } -} diff --git a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart deleted file mode 100644 index 58c86590..00000000 --- a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart +++ /dev/null @@ -1,144 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'dao_inheritance_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _personInsertionAdapter = InsertionAdapter( - database, - 'Person', - (Person item) => - {'id': item.id, 'name': item.name}); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM Person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int, row['name'] as String), - arguments: [id]); - } - - @override - Future insertItem(Person item) async { - await _personInsertionAdapter.insert(item, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart deleted file mode 100644 index 2de28d1f..00000000 --- a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart +++ /dev/null @@ -1,170 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'entity_inheritance_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - CommentDao? _commentDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `comments` (`author` TEXT NOT NULL, `content` TEXT NOT NULL, `id` INTEGER NOT NULL, `create_time` TEXT NOT NULL, `update_time` TEXT, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - CommentDao get commentDao { - return _commentDaoInstance ??= _$CommentDao(database, changeListener); - } -} - -class _$CommentDao extends CommentDao { - _$CommentDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _commentInsertionAdapter = InsertionAdapter( - database, - 'comments', - (Comment item) => { - 'author': item.author, - 'content': item.content, - 'id': item.id, - 'create_time': item.createTime, - 'update_time': item.updateTime - }), - _commentDeletionAdapter = DeletionAdapter( - database, - 'comments', - ['id'], - (Comment item) => { - 'author': item.author, - 'content': item.content, - 'id': item.id, - 'create_time': item.createTime, - 'update_time': item.updateTime - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _commentInsertionAdapter; - - final DeletionAdapter _commentDeletionAdapter; - - @override - Future findCommentById(int id) async { - return _queryAdapter.query('SELECT * FROM comments WHERE id = ?1', - mapper: (Map row) => Comment( - row['id'] as int, row['author'] as String, - content: row['content'] as String, - createTime: row['create_time'] as String?, - updateTime: row['update_time'] as String?), - arguments: [id]); - } - - @override - Future addComment(Comment c) async { - await _commentInsertionAdapter.insert(c, OnConflictStrategy.abort); - } - - @override - Future removeComment(Comment c) async { - await _commentDeletionAdapter.delete(c); - } -} diff --git a/floor_common/test/integration/type_converter/order_database.g.dart b/floor_common/test/integration/type_converter/order_database.g.dart deleted file mode 100644 index 3746ee41..00000000 --- a/floor_common/test/integration/type_converter/order_database.g.dart +++ /dev/null @@ -1,166 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'order_database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $OrderDatabaseBuilderContract { - /// Adds migrations to the builder. - $OrderDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $OrderDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorOrderDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $OrderDatabaseBuilderContract databaseBuilder(String name) => - _$OrderDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $OrderDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$OrderDatabaseBuilder(null); -} - -class _$OrderDatabaseBuilder implements $OrderDatabaseBuilderContract { - _$OrderDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $OrderDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $OrderDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$OrderDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$OrderDatabase extends OrderDatabase { - _$OrderDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - OrderDao? _orderDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Order` (`id` INTEGER NOT NULL, `date` INTEGER NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - OrderDao get orderDao { - return _orderDaoInstance ??= _$OrderDao(database, changeListener); - } -} - -class _$OrderDao extends OrderDao { - _$OrderDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _orderInsertionAdapter = InsertionAdapter( - database, - 'Order', - (Order item) => { - 'id': item.id, - 'date': _dateTimeConverter.encode(item.date) - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _orderInsertionAdapter; - - @override - Future> findOrdersByDate(DateTime date) async { - return _queryAdapter.queryList('SELECT * FROM `Order` WHERE date = ?1', - mapper: (Map row) => Order( - row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), - arguments: [_dateTimeConverter.encode(date)]); - } - - @override - Future> findOrdersByDates(List dates) async { - const offset = 1; - final _sqliteVariablesForDates = - Iterable.generate(dates.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM `Order` WHERE date IN (' + - _sqliteVariablesForDates + - ')', - mapper: (Map row) => Order( - row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), - arguments: [ - ...dates.map((element) => _dateTimeConverter.encode(element)) - ]); - } - - @override - Future insertOrder(Order order) async { - await _orderInsertionAdapter.insert(order, OnConflictStrategy.abort); - } -} - -// ignore_for_file: unused_element -final _dateTimeConverter = DateTimeConverter(); diff --git a/floor_common/test/integration/view/view_test.g.dart b/floor_common/test/integration/view/view_test.g.dart deleted file mode 100644 index b168d05e..00000000 --- a/floor_common/test/integration/view/view_test.g.dart +++ /dev/null @@ -1,521 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'view_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $ViewTestDatabaseBuilderContract { - /// Adds migrations to the builder. - $ViewTestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $ViewTestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorViewTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $ViewTestDatabaseBuilderContract databaseBuilder(String name) => - _$ViewTestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $ViewTestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$ViewTestDatabaseBuilder(null); -} - -class _$ViewTestDatabaseBuilder implements $ViewTestDatabaseBuilderContract { - _$ViewTestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $ViewTestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $ViewTestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$ViewTestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$ViewTestDatabase extends ViewTestDatabase { - _$ViewTestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - DogDao? _dogDaoInstance; - - NameDao? _nameDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); - await database.execute( - 'CREATE VIEW IF NOT EXISTS `names` AS SELECT custom_name as name FROM person UNION SELECT name from dog'); - await database.execute( - 'CREATE VIEW IF NOT EXISTS `multiline_query_names` AS SELECT custom_name as name \n FROM person \n UNION SELECT name from dog\n '); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } - - @override - DogDao get dogDao { - return _dogDaoInstance ??= _$DogDao(database, changeListener); - } - - @override - NameDao get nameDao { - return _nameDaoInstance ??= _$NameDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _personInsertionAdapter = InsertionAdapter( - database, - 'person', - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personUpdateAdapter = UpdateAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personDeletionAdapter = DeletionAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - final UpdateAdapter _personUpdateAdapter; - - final DeletionAdapter _personDeletionAdapter; - - @override - Future> findAllPersons() async { - return _queryAdapter.queryList('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Stream> findAllPersonsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - queryableName: 'person', - isView: false); - } - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id]); - } - - @override - Stream findPersonByIdAsStream(int id) { - return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id], - queryableName: 'person', - isView: false); - } - - @override - Stream uniqueRecordsCountAsStream() { - return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', - mapper: (Map row) => row.values.first as int, - queryableName: 'person', - isView: false); - } - - @override - Future findPersonByIdAndName( - int id, - String name, - ) async { - return _queryAdapter.query( - 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id, name]); - } - - @override - Future> findPersonsWithIds(List ids) async { - const offset = 1; - final _sqliteVariablesForIds = - Iterable.generate(ids.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...ids]); - } - - @override - Future> findPersonsWithNames(List names) async { - const offset = 1; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...names]); - } - - @override - Future> findPersonsWithNamesComplex( - int reference, - List names, - List moreNames, - ) async { - int offset = 2; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - offset += names.length; - final _sqliteVariablesForMoreNames = - Iterable.generate(moreNames.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ') AND id>=?1 OR custom_name IN (' + - _sqliteVariablesForMoreNames + - ') AND id<=?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [reference, ...names, ...moreNames]); - } - - @override - Future> findPersonsWithNamesLike(String name) async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name LIKE ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [name]); - } - - @override - Future> findPersonsWithEmptyName() async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name == \'\'', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Future deleteAllPersons() async { - await _queryAdapter.queryNoReturn('DELETE FROM person'); - } - - @override - Stream> findAllDogsOfPersonAsStream(int id) { - return _queryAdapter.queryListStream( - 'SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id], - queryableName: 'dog', - isView: false); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); - } - - @override - Future insertPersons(List persons) async { - await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); - } - - @override - Future insertPersonWithReturn(Person person) { - return _personInsertionAdapter.insertAndReturnId( - person, OnConflictStrategy.abort); - } - - @override - Future> insertPersonsWithReturn(List persons) { - return _personInsertionAdapter.insertListAndReturnIds( - persons, OnConflictStrategy.abort); - } - - @override - Future updatePerson(Person person) async { - await _personUpdateAdapter.update(person, OnConflictStrategy.abort); - } - - @override - Future updatePersons(List persons) async { - await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); - } - - @override - Future updatePersonWithReturn(Person person) { - return _personUpdateAdapter.updateAndReturnChangedRows( - person, OnConflictStrategy.abort); - } - - @override - Future updatePersonsWithReturn(List persons) { - return _personUpdateAdapter.updateListAndReturnChangedRows( - persons, OnConflictStrategy.abort); - } - - @override - Future deletePerson(Person person) async { - await _personDeletionAdapter.delete(person); - } - - @override - Future deletePersons(List person) async { - await _personDeletionAdapter.deleteList(person); - } - - @override - Future deletePersonWithReturn(Person person) { - return _personDeletionAdapter.deleteAndReturnChangedRows(person); - } - - @override - Future deletePersonsWithReturn(List persons) { - return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); - } - - @override - Future replacePersons(List persons) async { - if (database is sqflite.Transaction) { - await super.replacePersons(persons); - } else { - await (database as sqflite.Database) - .transaction((transaction) async { - final transactionDatabase = _$ViewTestDatabase(changeListener) - ..database = transaction; - await transactionDatabase.personDao.replacePersons(persons); - }); - } - } - - @override - Future> replacePersonsAndReturn(List persons) async { - if (database is sqflite.Transaction) { - return super.replacePersonsAndReturn(persons); - } else { - return (database as sqflite.Database) - .transaction>((transaction) async { - final transactionDatabase = _$ViewTestDatabase(changeListener) - ..database = transaction; - return transactionDatabase.personDao.replacePersonsAndReturn(persons); - }); - } - } -} - -class _$DogDao extends DogDao { - _$DogDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _dogInsertionAdapter = InsertionAdapter( - database, - 'dog', - (Dog item) => { - 'id': item.id, - 'name': item.name, - 'nick_name': item.nickName, - 'owner_id': item.ownerId - }, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _dogInsertionAdapter; - - @override - Future findDogForPersonId(int id) async { - return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id]); - } - - @override - Future> findAllDogs() async { - return _queryAdapter.queryList('SELECT * FROM dog', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int)); - } - - @override - Future insertDog(Dog dog) async { - await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); - } -} - -class _$NameDao extends NameDao { - _$NameDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - @override - Future> findAllNames() async { - return _queryAdapter.queryList('SELECT * FROM names ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String)); - } - - @override - Stream> findAllNamesAsStream() { - return _queryAdapter.queryListStream( - 'SELECT * FROM names ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - queryableName: 'names', - isView: true); - } - - @override - Future findExactName(String name) async { - return _queryAdapter.query('SELECT * FROM names WHERE name = ?1', - mapper: (Map row) => Name(row['name'] as String), - arguments: [name]); - } - - @override - Future> findNamesLike(String suffix) async { - return _queryAdapter.queryList( - 'SELECT * FROM names WHERE name LIKE ?1 ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - arguments: [suffix]); - } - - @override - Future> findNamesMatchingBoth( - String prefix, - String suffix, - ) async { - return _queryAdapter.queryList( - 'SELECT * FROM names WHERE name LIKE ?2 AND name LIKE ?1 ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - arguments: [prefix, suffix]); - } - - @override - Future findMultilineQueryName(String name) async { - return _queryAdapter.query( - 'SELECT * FROM multiline_query_names WHERE name = ?1', - mapper: (Map row) => - MultilineQueryName(row['name'] as String), - arguments: [name]); - } -} From 6d61ffb724117105007284c60cb072a2359db4de Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Mon, 29 Apr 2024 09:30:46 +0200 Subject: [PATCH 14/22] Add .g files --- .../autoincrement/autoinc_test.g.dart | 151 +++++ .../test/integration/blob/blob_test.g.dart | 147 +++++ .../boolean_conversions/bool_test.g.dart | 175 ++++++ floor_common/test/integration/database.g.dart | 447 +++++++++++++++ .../test/integration/fts/mail_database.g.dart | 212 +++++++ .../inheritance/dao_inheritance_test.g.dart | 144 +++++ .../entity_inheritance_test.g.dart | 170 ++++++ .../type_converter/order_database.g.dart | 166 ++++++ .../test/integration/view/view_test.g.dart | 521 ++++++++++++++++++ 9 files changed, 2133 insertions(+) create mode 100644 floor_common/test/integration/autoincrement/autoinc_test.g.dart create mode 100644 floor_common/test/integration/blob/blob_test.g.dart create mode 100644 floor_common/test/integration/boolean_conversions/bool_test.g.dart create mode 100644 floor_common/test/integration/database.g.dart create mode 100644 floor_common/test/integration/fts/mail_database.g.dart create mode 100644 floor_common/test/integration/inheritance/dao_inheritance_test.g.dart create mode 100644 floor_common/test/integration/inheritance/entity_inheritance_test.g.dart create mode 100644 floor_common/test/integration/type_converter/order_database.g.dart create mode 100644 floor_common/test/integration/view/view_test.g.dart diff --git a/floor_common/test/integration/autoincrement/autoinc_test.g.dart b/floor_common/test/integration/autoincrement/autoinc_test.g.dart new file mode 100644 index 00000000..875cfb82 --- /dev/null +++ b/floor_common/test/integration/autoincrement/autoinc_test.g.dart @@ -0,0 +1,151 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'autoinc_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + AIDao? _aiDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `AutoIncEntity` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `decimal` REAL NOT NULL)'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + AIDao get aiDao { + return _aiDaoInstance ??= _$AIDao(database, changeListener); + } +} + +class _$AIDao extends AIDao { + _$AIDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _autoIncEntityInsertionAdapter = InsertionAdapter( + database, + 'AutoIncEntity', + (AutoIncEntity item) => + {'id': item.id, 'decimal': item.decimal}); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _autoIncEntityInsertionAdapter; + + @override + Future findWithId(int val) async { + return _queryAdapter.query('SELECT * FROM AutoIncEntity where id = ?1', + mapper: (Map row) => + AutoIncEntity(row['decimal'] as double, id: row['id'] as int?), + arguments: [val]); + } + + @override + Future> findAll() async { + return _queryAdapter.queryList('SELECT * FROM AutoIncEntity', + mapper: (Map row) => + AutoIncEntity(row['decimal'] as double, id: row['id'] as int?)); + } + + @override + Future insertAIEntity(AutoIncEntity e) async { + await _autoIncEntityInsertionAdapter.insert(e, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/blob/blob_test.g.dart b/floor_common/test/integration/blob/blob_test.g.dart new file mode 100644 index 00000000..54932cb0 --- /dev/null +++ b/floor_common/test/integration/blob/blob_test.g.dart @@ -0,0 +1,147 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'blob_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `picture` BLOB NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _personInsertionAdapter = InsertionAdapter( + database, + 'Person', + (Person item) => { + 'id': item.id, + 'name': item.name, + 'picture': item.picture + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + @override + Future findPersonByPicture(Uint8List picture) async { + return _queryAdapter.query('SELECT * FROM Person WHERE picture = ?1', + mapper: (Map row) => Person(row['id'] as int, + row['name'] as String, row['picture'] as Uint8List), + arguments: [picture]); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/boolean_conversions/bool_test.g.dart b/floor_common/test/integration/boolean_conversions/bool_test.g.dart new file mode 100644 index 00000000..d517c02f --- /dev/null +++ b/floor_common/test/integration/boolean_conversions/bool_test.g.dart @@ -0,0 +1,175 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'bool_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + BoolDao? _boolDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `BooleanClass` (`id` INTEGER, `nullable` INTEGER, `nonNullable` INTEGER NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + BoolDao get boolDao { + return _boolDaoInstance ??= _$BoolDao(database, changeListener); + } +} + +class _$BoolDao extends BoolDao { + _$BoolDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _booleanClassInsertionAdapter = InsertionAdapter( + database, + 'BooleanClass', + (BooleanClass item) => { + 'id': item.id == null ? null : (item.id! ? 1 : 0), + 'nullable': + item.nullable == null ? null : (item.nullable! ? 1 : 0), + 'nonNullable': item.nonNullable ? 1 : 0 + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _booleanClassInsertionAdapter; + + @override + Future findWithNonNullable(bool val) async { + return _queryAdapter.query( + 'SELECT * FROM BooleanClass where nonNullable = ?1', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0), + arguments: [val ? 1 : 0]); + } + + @override + Future findWithNullable(bool val) async { + return _queryAdapter.query('SELECT * FROM BooleanClass where nullable = ?1', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0), + arguments: [val ? 1 : 0]); + } + + @override + Future findWithNullableBeingNull() async { + return _queryAdapter.query( + 'SELECT * FROM BooleanClass where nullable IS NULL', + mapper: (Map row) => BooleanClass( + row['id'] == null ? null : (row['id'] as int) != 0, + nullable: + row['nullable'] == null ? null : (row['nullable'] as int) != 0, + nonNullable: (row['nonNullable'] as int) != 0)); + } + + @override + Future insertBoolC(BooleanClass person) async { + await _booleanClassInsertionAdapter.insert( + person, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/database.g.dart b/floor_common/test/integration/database.g.dart new file mode 100644 index 00000000..35f5f67f --- /dev/null +++ b/floor_common/test/integration/database.g.dart @@ -0,0 +1,447 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + DogDao? _dogDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 2, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } + + @override + DogDao get dogDao { + return _dogDaoInstance ??= _$DogDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _personInsertionAdapter = InsertionAdapter( + database, + 'person', + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personUpdateAdapter = UpdateAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personDeletionAdapter = DeletionAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + final UpdateAdapter _personUpdateAdapter; + + final DeletionAdapter _personDeletionAdapter; + + @override + Future> findAllPersons() async { + return _queryAdapter.queryList('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Stream> findAllPersonsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + queryableName: 'person', + isView: false); + } + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id]); + } + + @override + Stream findPersonByIdAsStream(int id) { + return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id], + queryableName: 'person', + isView: false); + } + + @override + Stream uniqueRecordsCountAsStream() { + return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', + mapper: (Map row) => row.values.first as int, + queryableName: 'person', + isView: false); + } + + @override + Future findPersonByIdAndName( + int id, + String name, + ) async { + return _queryAdapter.query( + 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id, name]); + } + + @override + Future> findPersonsWithIds(List ids) async { + const offset = 1; + final _sqliteVariablesForIds = + Iterable.generate(ids.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...ids]); + } + + @override + Future> findPersonsWithNames(List names) async { + const offset = 1; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...names]); + } + + @override + Future> findPersonsWithNamesComplex( + int reference, + List names, + List moreNames, + ) async { + int offset = 2; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + offset += names.length; + final _sqliteVariablesForMoreNames = + Iterable.generate(moreNames.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ') AND id>=?1 OR custom_name IN (' + + _sqliteVariablesForMoreNames + + ') AND id<=?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [reference, ...names, ...moreNames]); + } + + @override + Future> findPersonsWithNamesLike(String name) async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name LIKE ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [name]); + } + + @override + Future> findPersonsWithEmptyName() async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name == \'\'', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Future deleteAllPersons() async { + await _queryAdapter.queryNoReturn('DELETE FROM person'); + } + + @override + Stream> findAllDogsOfPersonAsStream(int id) { + return _queryAdapter.queryListStream( + 'SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id], + queryableName: 'dog', + isView: false); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); + } + + @override + Future insertPersons(List persons) async { + await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); + } + + @override + Future insertPersonWithReturn(Person person) { + return _personInsertionAdapter.insertAndReturnId( + person, OnConflictStrategy.abort); + } + + @override + Future> insertPersonsWithReturn(List persons) { + return _personInsertionAdapter.insertListAndReturnIds( + persons, OnConflictStrategy.abort); + } + + @override + Future updatePerson(Person person) async { + await _personUpdateAdapter.update(person, OnConflictStrategy.abort); + } + + @override + Future updatePersons(List persons) async { + await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); + } + + @override + Future updatePersonWithReturn(Person person) { + return _personUpdateAdapter.updateAndReturnChangedRows( + person, OnConflictStrategy.abort); + } + + @override + Future updatePersonsWithReturn(List persons) { + return _personUpdateAdapter.updateListAndReturnChangedRows( + persons, OnConflictStrategy.abort); + } + + @override + Future deletePerson(Person person) async { + await _personDeletionAdapter.delete(person); + } + + @override + Future deletePersons(List person) async { + await _personDeletionAdapter.deleteList(person); + } + + @override + Future deletePersonWithReturn(Person person) { + return _personDeletionAdapter.deleteAndReturnChangedRows(person); + } + + @override + Future deletePersonsWithReturn(List persons) { + return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); + } + + @override + Future replacePersons(List persons) async { + if (database is sqflite.Transaction) { + await super.replacePersons(persons); + } else { + await (database as sqflite.Database) + .transaction((transaction) async { + final transactionDatabase = _$TestDatabase(changeListener) + ..database = transaction; + await transactionDatabase.personDao.replacePersons(persons); + }); + } + } + + @override + Future> replacePersonsAndReturn(List persons) async { + if (database is sqflite.Transaction) { + return super.replacePersonsAndReturn(persons); + } else { + return (database as sqflite.Database) + .transaction>((transaction) async { + final transactionDatabase = _$TestDatabase(changeListener) + ..database = transaction; + return transactionDatabase.personDao.replacePersonsAndReturn(persons); + }); + } + } +} + +class _$DogDao extends DogDao { + _$DogDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _dogInsertionAdapter = InsertionAdapter( + database, + 'dog', + (Dog item) => { + 'id': item.id, + 'name': item.name, + 'nick_name': item.nickName, + 'owner_id': item.ownerId + }, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _dogInsertionAdapter; + + @override + Future findDogForPersonId(int id) async { + return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id]); + } + + @override + Future> findAllDogs() async { + return _queryAdapter.queryList('SELECT * FROM dog', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int)); + } + + @override + Future insertDog(Dog dog) async { + await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/fts/mail_database.g.dart b/floor_common/test/integration/fts/mail_database.g.dart new file mode 100644 index 00000000..bc803044 --- /dev/null +++ b/floor_common/test/integration/fts/mail_database.g.dart @@ -0,0 +1,212 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'mail_database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $MailDatabaseBuilderContract { + /// Adds migrations to the builder. + $MailDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $MailDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorMailDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $MailDatabaseBuilderContract databaseBuilder(String name) => + _$MailDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $MailDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$MailDatabaseBuilder(null); +} + +class _$MailDatabaseBuilder implements $MailDatabaseBuilderContract { + _$MailDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $MailDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $MailDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$MailDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$MailDatabase extends MailDatabase { + _$MailDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + MailDao? _mailDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE VIRTUAL TABLE IF NOT EXISTS `mail` USING fts4(`rowid` INTEGER NOT NULL, `text` TEXT NOT NULL, PRIMARY KEY (`rowid`), tokenize=unicode61 )'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + MailDao get mailDao { + return _mailDaoInstance ??= _$MailDao(database, changeListener); + } +} + +class _$MailDao extends MailDao { + _$MailDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _mailInsertionAdapter = InsertionAdapter( + database, + 'mail', + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener), + _mailUpdateAdapter = UpdateAdapter( + database, + 'mail', + ['rowid'], + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener), + _mailDeletionAdapter = DeletionAdapter( + database, + 'mail', + ['rowid'], + (Mail item) => + {'rowid': item.id, 'text': item.text}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _mailInsertionAdapter; + + final UpdateAdapter _mailUpdateAdapter; + + final DeletionAdapter _mailDeletionAdapter; + + @override + Future findMailById(int id) async { + return _queryAdapter.query('SELECT * FROM mail WHERE rowid = ?1', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + arguments: [id]); + } + + @override + Future> findMailByKey(String key) async { + return _queryAdapter.queryList('SELECT * FROM mail WHERE text match ?1', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + arguments: [key]); + } + + @override + Future> findAllMails() async { + return _queryAdapter.queryList('SELECT * FROM mail', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String)); + } + + @override + Stream> findAllMailsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM mail', + mapper: (Map row) => + Mail(row['rowid'] as int, row['text'] as String), + queryableName: 'mail', + isView: false); + } + + @override + Future insertMail(Mail mailInfo) async { + await _mailInsertionAdapter.insert(mailInfo, OnConflictStrategy.abort); + } + + @override + Future insertMails(List mailInfo) async { + await _mailInsertionAdapter.insertList(mailInfo, OnConflictStrategy.abort); + } + + @override + Future updateMail(Mail mailInfo) async { + await _mailUpdateAdapter.update(mailInfo, OnConflictStrategy.abort); + } + + @override + Future updateMails(List mailInfo) async { + await _mailUpdateAdapter.updateList(mailInfo, OnConflictStrategy.abort); + } + + @override + Future deleteMail(Mail mailInfo) async { + await _mailDeletionAdapter.delete(mailInfo); + } + + @override + Future deleteMails(List mailInfo) async { + await _mailDeletionAdapter.deleteList(mailInfo); + } +} diff --git a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart new file mode 100644 index 00000000..58c86590 --- /dev/null +++ b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart @@ -0,0 +1,144 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'dao_inheritance_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _personInsertionAdapter = InsertionAdapter( + database, + 'Person', + (Person item) => + {'id': item.id, 'name': item.name}); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM Person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int, row['name'] as String), + arguments: [id]); + } + + @override + Future insertItem(Person item) async { + await _personInsertionAdapter.insert(item, OnConflictStrategy.abort); + } +} diff --git a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart new file mode 100644 index 00000000..2de28d1f --- /dev/null +++ b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart @@ -0,0 +1,170 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'entity_inheritance_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $TestDatabaseBuilderContract { + /// Adds migrations to the builder. + $TestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $TestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract databaseBuilder(String name) => + _$TestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$TestDatabaseBuilder(null); +} + +class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { + _$TestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $TestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $TestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$TestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$TestDatabase extends TestDatabase { + _$TestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + CommentDao? _commentDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `comments` (`author` TEXT NOT NULL, `content` TEXT NOT NULL, `id` INTEGER NOT NULL, `create_time` TEXT NOT NULL, `update_time` TEXT, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + CommentDao get commentDao { + return _commentDaoInstance ??= _$CommentDao(database, changeListener); + } +} + +class _$CommentDao extends CommentDao { + _$CommentDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _commentInsertionAdapter = InsertionAdapter( + database, + 'comments', + (Comment item) => { + 'author': item.author, + 'content': item.content, + 'id': item.id, + 'create_time': item.createTime, + 'update_time': item.updateTime + }), + _commentDeletionAdapter = DeletionAdapter( + database, + 'comments', + ['id'], + (Comment item) => { + 'author': item.author, + 'content': item.content, + 'id': item.id, + 'create_time': item.createTime, + 'update_time': item.updateTime + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _commentInsertionAdapter; + + final DeletionAdapter _commentDeletionAdapter; + + @override + Future findCommentById(int id) async { + return _queryAdapter.query('SELECT * FROM comments WHERE id = ?1', + mapper: (Map row) => Comment( + row['id'] as int, row['author'] as String, + content: row['content'] as String, + createTime: row['create_time'] as String?, + updateTime: row['update_time'] as String?), + arguments: [id]); + } + + @override + Future addComment(Comment c) async { + await _commentInsertionAdapter.insert(c, OnConflictStrategy.abort); + } + + @override + Future removeComment(Comment c) async { + await _commentDeletionAdapter.delete(c); + } +} diff --git a/floor_common/test/integration/type_converter/order_database.g.dart b/floor_common/test/integration/type_converter/order_database.g.dart new file mode 100644 index 00000000..3746ee41 --- /dev/null +++ b/floor_common/test/integration/type_converter/order_database.g.dart @@ -0,0 +1,166 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'order_database.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $OrderDatabaseBuilderContract { + /// Adds migrations to the builder. + $OrderDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $OrderDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorOrderDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $OrderDatabaseBuilderContract databaseBuilder(String name) => + _$OrderDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $OrderDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$OrderDatabaseBuilder(null); +} + +class _$OrderDatabaseBuilder implements $OrderDatabaseBuilderContract { + _$OrderDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $OrderDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $OrderDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$OrderDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$OrderDatabase extends OrderDatabase { + _$OrderDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + OrderDao? _orderDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `Order` (`id` INTEGER NOT NULL, `date` INTEGER NOT NULL, PRIMARY KEY (`id`))'); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + OrderDao get orderDao { + return _orderDaoInstance ??= _$OrderDao(database, changeListener); + } +} + +class _$OrderDao extends OrderDao { + _$OrderDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _orderInsertionAdapter = InsertionAdapter( + database, + 'Order', + (Order item) => { + 'id': item.id, + 'date': _dateTimeConverter.encode(item.date) + }); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _orderInsertionAdapter; + + @override + Future> findOrdersByDate(DateTime date) async { + return _queryAdapter.queryList('SELECT * FROM `Order` WHERE date = ?1', + mapper: (Map row) => Order( + row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), + arguments: [_dateTimeConverter.encode(date)]); + } + + @override + Future> findOrdersByDates(List dates) async { + const offset = 1; + final _sqliteVariablesForDates = + Iterable.generate(dates.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM `Order` WHERE date IN (' + + _sqliteVariablesForDates + + ')', + mapper: (Map row) => Order( + row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), + arguments: [ + ...dates.map((element) => _dateTimeConverter.encode(element)) + ]); + } + + @override + Future insertOrder(Order order) async { + await _orderInsertionAdapter.insert(order, OnConflictStrategy.abort); + } +} + +// ignore_for_file: unused_element +final _dateTimeConverter = DateTimeConverter(); diff --git a/floor_common/test/integration/view/view_test.g.dart b/floor_common/test/integration/view/view_test.g.dart new file mode 100644 index 00000000..b168d05e --- /dev/null +++ b/floor_common/test/integration/view/view_test.g.dart @@ -0,0 +1,521 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'view_test.dart'; + +// ************************************************************************** +// FloorGenerator +// ************************************************************************** + +abstract class $ViewTestDatabaseBuilderContract { + /// Adds migrations to the builder. + $ViewTestDatabaseBuilderContract addMigrations(List migrations); + + /// Adds a database [Callback] to the builder. + $ViewTestDatabaseBuilderContract addCallback(Callback callback); + + /// Creates the database and initializes it. + Future build(); +} + +// ignore: avoid_classes_with_only_static_members +class $FloorViewTestDatabase { + /// Creates a database builder for a persistent database. + /// Once a database is built, you should keep a reference to it and re-use it. + static $ViewTestDatabaseBuilderContract databaseBuilder(String name) => + _$ViewTestDatabaseBuilder(name); + + /// Creates a database builder for an in memory database. + /// Information stored in an in memory database disappears when the process is killed. + /// Once a database is built, you should keep a reference to it and re-use it. + static $ViewTestDatabaseBuilderContract inMemoryDatabaseBuilder() => + _$ViewTestDatabaseBuilder(null); +} + +class _$ViewTestDatabaseBuilder implements $ViewTestDatabaseBuilderContract { + _$ViewTestDatabaseBuilder(this.name); + + final String? name; + + final List _migrations = []; + + Callback? _callback; + + @override + $ViewTestDatabaseBuilderContract addMigrations(List migrations) { + _migrations.addAll(migrations); + return this; + } + + @override + $ViewTestDatabaseBuilderContract addCallback(Callback callback) { + _callback = callback; + return this; + } + + @override + Future build() async { + final path = name != null + ? await sqfliteDatabaseFactory.getDatabasePath(name!) + : ':memory:'; + final database = _$ViewTestDatabase(); + database.database = await database.open( + path, + _migrations, + _callback, + ); + return database; + } +} + +class _$ViewTestDatabase extends ViewTestDatabase { + _$ViewTestDatabase([StreamController? listener]) { + changeListener = listener ?? StreamController.broadcast(); + } + + PersonDao? _personDaoInstance; + + DogDao? _dogDaoInstance; + + NameDao? _nameDaoInstance; + + Future open( + String path, + List migrations, [ + Callback? callback, + ]) async { + final databaseOptions = sqflite.OpenDatabaseOptions( + version: 1, + onConfigure: (database) async { + await database.execute('PRAGMA foreign_keys = ON'); + await callback?.onConfigure?.call(database); + }, + onOpen: (database) async { + await callback?.onOpen?.call(database); + }, + onUpgrade: (database, startVersion, endVersion) async { + await MigrationAdapter.runMigrations( + database, startVersion, endVersion, migrations); + + await callback?.onUpgrade?.call(database, startVersion, endVersion); + }, + onCreate: (database, version) async { + await database.execute( + 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); + await database.execute( + 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); + await database.execute( + 'CREATE VIEW IF NOT EXISTS `names` AS SELECT custom_name as name FROM person UNION SELECT name from dog'); + await database.execute( + 'CREATE VIEW IF NOT EXISTS `multiline_query_names` AS SELECT custom_name as name \n FROM person \n UNION SELECT name from dog\n '); + + await callback?.onCreate?.call(database, version); + }, + ); + return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); + } + + @override + PersonDao get personDao { + return _personDaoInstance ??= _$PersonDao(database, changeListener); + } + + @override + DogDao get dogDao { + return _dogDaoInstance ??= _$DogDao(database, changeListener); + } + + @override + NameDao get nameDao { + return _nameDaoInstance ??= _$NameDao(database, changeListener); + } +} + +class _$PersonDao extends PersonDao { + _$PersonDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener), + _personInsertionAdapter = InsertionAdapter( + database, + 'person', + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personUpdateAdapter = UpdateAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener), + _personDeletionAdapter = DeletionAdapter( + database, + 'person', + ['id'], + (Person item) => + {'id': item.id, 'custom_name': item.name}, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _personInsertionAdapter; + + final UpdateAdapter _personUpdateAdapter; + + final DeletionAdapter _personDeletionAdapter; + + @override + Future> findAllPersons() async { + return _queryAdapter.queryList('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Stream> findAllPersonsAsStream() { + return _queryAdapter.queryListStream('SELECT * FROM person', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + queryableName: 'person', + isView: false); + } + + @override + Future findPersonById(int id) async { + return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id]); + } + + @override + Stream findPersonByIdAsStream(int id) { + return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id], + queryableName: 'person', + isView: false); + } + + @override + Stream uniqueRecordsCountAsStream() { + return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', + mapper: (Map row) => row.values.first as int, + queryableName: 'person', + isView: false); + } + + @override + Future findPersonByIdAndName( + int id, + String name, + ) async { + return _queryAdapter.query( + 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [id, name]); + } + + @override + Future> findPersonsWithIds(List ids) async { + const offset = 1; + final _sqliteVariablesForIds = + Iterable.generate(ids.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...ids]); + } + + @override + Future> findPersonsWithNames(List names) async { + const offset = 1; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ')', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [...names]); + } + + @override + Future> findPersonsWithNamesComplex( + int reference, + List names, + List moreNames, + ) async { + int offset = 2; + final _sqliteVariablesForNames = + Iterable.generate(names.length, (i) => '?${i + offset}') + .join(','); + offset += names.length; + final _sqliteVariablesForMoreNames = + Iterable.generate(moreNames.length, (i) => '?${i + offset}') + .join(','); + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name IN (' + + _sqliteVariablesForNames + + ') AND id>=?1 OR custom_name IN (' + + _sqliteVariablesForMoreNames + + ') AND id<=?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [reference, ...names, ...moreNames]); + } + + @override + Future> findPersonsWithNamesLike(String name) async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name LIKE ?1', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String), + arguments: [name]); + } + + @override + Future> findPersonsWithEmptyName() async { + return _queryAdapter.queryList( + 'SELECT * FROM person WHERE custom_name == \'\'', + mapper: (Map row) => + Person(row['id'] as int?, row['custom_name'] as String)); + } + + @override + Future deleteAllPersons() async { + await _queryAdapter.queryNoReturn('DELETE FROM person'); + } + + @override + Stream> findAllDogsOfPersonAsStream(int id) { + return _queryAdapter.queryListStream( + 'SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id], + queryableName: 'dog', + isView: false); + } + + @override + Future insertPerson(Person person) async { + await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); + } + + @override + Future insertPersons(List persons) async { + await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); + } + + @override + Future insertPersonWithReturn(Person person) { + return _personInsertionAdapter.insertAndReturnId( + person, OnConflictStrategy.abort); + } + + @override + Future> insertPersonsWithReturn(List persons) { + return _personInsertionAdapter.insertListAndReturnIds( + persons, OnConflictStrategy.abort); + } + + @override + Future updatePerson(Person person) async { + await _personUpdateAdapter.update(person, OnConflictStrategy.abort); + } + + @override + Future updatePersons(List persons) async { + await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); + } + + @override + Future updatePersonWithReturn(Person person) { + return _personUpdateAdapter.updateAndReturnChangedRows( + person, OnConflictStrategy.abort); + } + + @override + Future updatePersonsWithReturn(List persons) { + return _personUpdateAdapter.updateListAndReturnChangedRows( + persons, OnConflictStrategy.abort); + } + + @override + Future deletePerson(Person person) async { + await _personDeletionAdapter.delete(person); + } + + @override + Future deletePersons(List person) async { + await _personDeletionAdapter.deleteList(person); + } + + @override + Future deletePersonWithReturn(Person person) { + return _personDeletionAdapter.deleteAndReturnChangedRows(person); + } + + @override + Future deletePersonsWithReturn(List persons) { + return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); + } + + @override + Future replacePersons(List persons) async { + if (database is sqflite.Transaction) { + await super.replacePersons(persons); + } else { + await (database as sqflite.Database) + .transaction((transaction) async { + final transactionDatabase = _$ViewTestDatabase(changeListener) + ..database = transaction; + await transactionDatabase.personDao.replacePersons(persons); + }); + } + } + + @override + Future> replacePersonsAndReturn(List persons) async { + if (database is sqflite.Transaction) { + return super.replacePersonsAndReturn(persons); + } else { + return (database as sqflite.Database) + .transaction>((transaction) async { + final transactionDatabase = _$ViewTestDatabase(changeListener) + ..database = transaction; + return transactionDatabase.personDao.replacePersonsAndReturn(persons); + }); + } + } +} + +class _$DogDao extends DogDao { + _$DogDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database), + _dogInsertionAdapter = InsertionAdapter( + database, + 'dog', + (Dog item) => { + 'id': item.id, + 'name': item.name, + 'nick_name': item.nickName, + 'owner_id': item.ownerId + }, + changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + final InsertionAdapter _dogInsertionAdapter; + + @override + Future findDogForPersonId(int id) async { + return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int), + arguments: [id]); + } + + @override + Future> findAllDogs() async { + return _queryAdapter.queryList('SELECT * FROM dog', + mapper: (Map row) => Dog( + row['id'] as int?, + row['name'] as String, + row['nick_name'] as String, + row['owner_id'] as int)); + } + + @override + Future insertDog(Dog dog) async { + await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); + } +} + +class _$NameDao extends NameDao { + _$NameDao( + this.database, + this.changeListener, + ) : _queryAdapter = QueryAdapter(database, changeListener); + + final sqflite.DatabaseExecutor database; + + final StreamController changeListener; + + final QueryAdapter _queryAdapter; + + @override + Future> findAllNames() async { + return _queryAdapter.queryList('SELECT * FROM names ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String)); + } + + @override + Stream> findAllNamesAsStream() { + return _queryAdapter.queryListStream( + 'SELECT * FROM names ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + queryableName: 'names', + isView: true); + } + + @override + Future findExactName(String name) async { + return _queryAdapter.query('SELECT * FROM names WHERE name = ?1', + mapper: (Map row) => Name(row['name'] as String), + arguments: [name]); + } + + @override + Future> findNamesLike(String suffix) async { + return _queryAdapter.queryList( + 'SELECT * FROM names WHERE name LIKE ?1 ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + arguments: [suffix]); + } + + @override + Future> findNamesMatchingBoth( + String prefix, + String suffix, + ) async { + return _queryAdapter.queryList( + 'SELECT * FROM names WHERE name LIKE ?2 AND name LIKE ?1 ORDER BY name ASC', + mapper: (Map row) => Name(row['name'] as String), + arguments: [prefix, suffix]); + } + + @override + Future findMultilineQueryName(String name) async { + return _queryAdapter.query( + 'SELECT * FROM multiline_query_names WHERE name = ?1', + mapper: (Map row) => + MultilineQueryName(row['name'] as String), + arguments: [name]); + } +} From 6b163f9efdfd307eaf66ea4769013f2d938b17b6 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Mon, 29 Apr 2024 09:35:34 +0200 Subject: [PATCH 15/22] gitignore rollback --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 10d6e236..3406c8e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Miscellaneous -floor_common/**/*.g.dart +floor/**/*.g.dart *.class *.log *.pyc From 44802b1d8e909c7ca3b2ae657cd9fcd1998400d7 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Mon, 29 Apr 2024 09:41:27 +0200 Subject: [PATCH 16/22] Delete .g files and update gitignore --- .gitignore | 2 +- .../autoincrement/autoinc_test.g.dart | 151 ----- .../test/integration/blob/blob_test.g.dart | 147 ----- .../boolean_conversions/bool_test.g.dart | 175 ------ floor_common/test/integration/database.g.dart | 447 --------------- .../test/integration/fts/mail_database.g.dart | 212 ------- .../inheritance/dao_inheritance_test.g.dart | 144 ----- .../entity_inheritance_test.g.dart | 170 ------ .../type_converter/order_database.g.dart | 166 ------ .../test/integration/view/view_test.g.dart | 521 ------------------ 10 files changed, 1 insertion(+), 2134 deletions(-) delete mode 100644 floor_common/test/integration/autoincrement/autoinc_test.g.dart delete mode 100644 floor_common/test/integration/blob/blob_test.g.dart delete mode 100644 floor_common/test/integration/boolean_conversions/bool_test.g.dart delete mode 100644 floor_common/test/integration/database.g.dart delete mode 100644 floor_common/test/integration/fts/mail_database.g.dart delete mode 100644 floor_common/test/integration/inheritance/dao_inheritance_test.g.dart delete mode 100644 floor_common/test/integration/inheritance/entity_inheritance_test.g.dart delete mode 100644 floor_common/test/integration/type_converter/order_database.g.dart delete mode 100644 floor_common/test/integration/view/view_test.g.dart diff --git a/.gitignore b/.gitignore index 3406c8e2..10d6e236 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # Miscellaneous -floor/**/*.g.dart +floor_common/**/*.g.dart *.class *.log *.pyc diff --git a/floor_common/test/integration/autoincrement/autoinc_test.g.dart b/floor_common/test/integration/autoincrement/autoinc_test.g.dart deleted file mode 100644 index 875cfb82..00000000 --- a/floor_common/test/integration/autoincrement/autoinc_test.g.dart +++ /dev/null @@ -1,151 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'autoinc_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - AIDao? _aiDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `AutoIncEntity` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `decimal` REAL NOT NULL)'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - AIDao get aiDao { - return _aiDaoInstance ??= _$AIDao(database, changeListener); - } -} - -class _$AIDao extends AIDao { - _$AIDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _autoIncEntityInsertionAdapter = InsertionAdapter( - database, - 'AutoIncEntity', - (AutoIncEntity item) => - {'id': item.id, 'decimal': item.decimal}); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _autoIncEntityInsertionAdapter; - - @override - Future findWithId(int val) async { - return _queryAdapter.query('SELECT * FROM AutoIncEntity where id = ?1', - mapper: (Map row) => - AutoIncEntity(row['decimal'] as double, id: row['id'] as int?), - arguments: [val]); - } - - @override - Future> findAll() async { - return _queryAdapter.queryList('SELECT * FROM AutoIncEntity', - mapper: (Map row) => - AutoIncEntity(row['decimal'] as double, id: row['id'] as int?)); - } - - @override - Future insertAIEntity(AutoIncEntity e) async { - await _autoIncEntityInsertionAdapter.insert(e, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/blob/blob_test.g.dart b/floor_common/test/integration/blob/blob_test.g.dart deleted file mode 100644 index 54932cb0..00000000 --- a/floor_common/test/integration/blob/blob_test.g.dart +++ /dev/null @@ -1,147 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'blob_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `picture` BLOB NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _personInsertionAdapter = InsertionAdapter( - database, - 'Person', - (Person item) => { - 'id': item.id, - 'name': item.name, - 'picture': item.picture - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - @override - Future findPersonByPicture(Uint8List picture) async { - return _queryAdapter.query('SELECT * FROM Person WHERE picture = ?1', - mapper: (Map row) => Person(row['id'] as int, - row['name'] as String, row['picture'] as Uint8List), - arguments: [picture]); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/boolean_conversions/bool_test.g.dart b/floor_common/test/integration/boolean_conversions/bool_test.g.dart deleted file mode 100644 index d517c02f..00000000 --- a/floor_common/test/integration/boolean_conversions/bool_test.g.dart +++ /dev/null @@ -1,175 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'bool_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - BoolDao? _boolDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `BooleanClass` (`id` INTEGER, `nullable` INTEGER, `nonNullable` INTEGER NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - BoolDao get boolDao { - return _boolDaoInstance ??= _$BoolDao(database, changeListener); - } -} - -class _$BoolDao extends BoolDao { - _$BoolDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _booleanClassInsertionAdapter = InsertionAdapter( - database, - 'BooleanClass', - (BooleanClass item) => { - 'id': item.id == null ? null : (item.id! ? 1 : 0), - 'nullable': - item.nullable == null ? null : (item.nullable! ? 1 : 0), - 'nonNullable': item.nonNullable ? 1 : 0 - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _booleanClassInsertionAdapter; - - @override - Future findWithNonNullable(bool val) async { - return _queryAdapter.query( - 'SELECT * FROM BooleanClass where nonNullable = ?1', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0), - arguments: [val ? 1 : 0]); - } - - @override - Future findWithNullable(bool val) async { - return _queryAdapter.query('SELECT * FROM BooleanClass where nullable = ?1', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0), - arguments: [val ? 1 : 0]); - } - - @override - Future findWithNullableBeingNull() async { - return _queryAdapter.query( - 'SELECT * FROM BooleanClass where nullable IS NULL', - mapper: (Map row) => BooleanClass( - row['id'] == null ? null : (row['id'] as int) != 0, - nullable: - row['nullable'] == null ? null : (row['nullable'] as int) != 0, - nonNullable: (row['nonNullable'] as int) != 0)); - } - - @override - Future insertBoolC(BooleanClass person) async { - await _booleanClassInsertionAdapter.insert( - person, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/database.g.dart b/floor_common/test/integration/database.g.dart deleted file mode 100644 index 35f5f67f..00000000 --- a/floor_common/test/integration/database.g.dart +++ /dev/null @@ -1,447 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - DogDao? _dogDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 2, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } - - @override - DogDao get dogDao { - return _dogDaoInstance ??= _$DogDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _personInsertionAdapter = InsertionAdapter( - database, - 'person', - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personUpdateAdapter = UpdateAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personDeletionAdapter = DeletionAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - final UpdateAdapter _personUpdateAdapter; - - final DeletionAdapter _personDeletionAdapter; - - @override - Future> findAllPersons() async { - return _queryAdapter.queryList('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Stream> findAllPersonsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - queryableName: 'person', - isView: false); - } - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id]); - } - - @override - Stream findPersonByIdAsStream(int id) { - return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id], - queryableName: 'person', - isView: false); - } - - @override - Stream uniqueRecordsCountAsStream() { - return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', - mapper: (Map row) => row.values.first as int, - queryableName: 'person', - isView: false); - } - - @override - Future findPersonByIdAndName( - int id, - String name, - ) async { - return _queryAdapter.query( - 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id, name]); - } - - @override - Future> findPersonsWithIds(List ids) async { - const offset = 1; - final _sqliteVariablesForIds = - Iterable.generate(ids.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...ids]); - } - - @override - Future> findPersonsWithNames(List names) async { - const offset = 1; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...names]); - } - - @override - Future> findPersonsWithNamesComplex( - int reference, - List names, - List moreNames, - ) async { - int offset = 2; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - offset += names.length; - final _sqliteVariablesForMoreNames = - Iterable.generate(moreNames.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ') AND id>=?1 OR custom_name IN (' + - _sqliteVariablesForMoreNames + - ') AND id<=?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [reference, ...names, ...moreNames]); - } - - @override - Future> findPersonsWithNamesLike(String name) async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name LIKE ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [name]); - } - - @override - Future> findPersonsWithEmptyName() async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name == \'\'', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Future deleteAllPersons() async { - await _queryAdapter.queryNoReturn('DELETE FROM person'); - } - - @override - Stream> findAllDogsOfPersonAsStream(int id) { - return _queryAdapter.queryListStream( - 'SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id], - queryableName: 'dog', - isView: false); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); - } - - @override - Future insertPersons(List persons) async { - await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); - } - - @override - Future insertPersonWithReturn(Person person) { - return _personInsertionAdapter.insertAndReturnId( - person, OnConflictStrategy.abort); - } - - @override - Future> insertPersonsWithReturn(List persons) { - return _personInsertionAdapter.insertListAndReturnIds( - persons, OnConflictStrategy.abort); - } - - @override - Future updatePerson(Person person) async { - await _personUpdateAdapter.update(person, OnConflictStrategy.abort); - } - - @override - Future updatePersons(List persons) async { - await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); - } - - @override - Future updatePersonWithReturn(Person person) { - return _personUpdateAdapter.updateAndReturnChangedRows( - person, OnConflictStrategy.abort); - } - - @override - Future updatePersonsWithReturn(List persons) { - return _personUpdateAdapter.updateListAndReturnChangedRows( - persons, OnConflictStrategy.abort); - } - - @override - Future deletePerson(Person person) async { - await _personDeletionAdapter.delete(person); - } - - @override - Future deletePersons(List person) async { - await _personDeletionAdapter.deleteList(person); - } - - @override - Future deletePersonWithReturn(Person person) { - return _personDeletionAdapter.deleteAndReturnChangedRows(person); - } - - @override - Future deletePersonsWithReturn(List persons) { - return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); - } - - @override - Future replacePersons(List persons) async { - if (database is sqflite.Transaction) { - await super.replacePersons(persons); - } else { - await (database as sqflite.Database) - .transaction((transaction) async { - final transactionDatabase = _$TestDatabase(changeListener) - ..database = transaction; - await transactionDatabase.personDao.replacePersons(persons); - }); - } - } - - @override - Future> replacePersonsAndReturn(List persons) async { - if (database is sqflite.Transaction) { - return super.replacePersonsAndReturn(persons); - } else { - return (database as sqflite.Database) - .transaction>((transaction) async { - final transactionDatabase = _$TestDatabase(changeListener) - ..database = transaction; - return transactionDatabase.personDao.replacePersonsAndReturn(persons); - }); - } - } -} - -class _$DogDao extends DogDao { - _$DogDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _dogInsertionAdapter = InsertionAdapter( - database, - 'dog', - (Dog item) => { - 'id': item.id, - 'name': item.name, - 'nick_name': item.nickName, - 'owner_id': item.ownerId - }, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _dogInsertionAdapter; - - @override - Future findDogForPersonId(int id) async { - return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id]); - } - - @override - Future> findAllDogs() async { - return _queryAdapter.queryList('SELECT * FROM dog', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int)); - } - - @override - Future insertDog(Dog dog) async { - await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/fts/mail_database.g.dart b/floor_common/test/integration/fts/mail_database.g.dart deleted file mode 100644 index bc803044..00000000 --- a/floor_common/test/integration/fts/mail_database.g.dart +++ /dev/null @@ -1,212 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'mail_database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $MailDatabaseBuilderContract { - /// Adds migrations to the builder. - $MailDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $MailDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorMailDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $MailDatabaseBuilderContract databaseBuilder(String name) => - _$MailDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $MailDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$MailDatabaseBuilder(null); -} - -class _$MailDatabaseBuilder implements $MailDatabaseBuilderContract { - _$MailDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $MailDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $MailDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$MailDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$MailDatabase extends MailDatabase { - _$MailDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - MailDao? _mailDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE VIRTUAL TABLE IF NOT EXISTS `mail` USING fts4(`rowid` INTEGER NOT NULL, `text` TEXT NOT NULL, PRIMARY KEY (`rowid`), tokenize=unicode61 )'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - MailDao get mailDao { - return _mailDaoInstance ??= _$MailDao(database, changeListener); - } -} - -class _$MailDao extends MailDao { - _$MailDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _mailInsertionAdapter = InsertionAdapter( - database, - 'mail', - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener), - _mailUpdateAdapter = UpdateAdapter( - database, - 'mail', - ['rowid'], - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener), - _mailDeletionAdapter = DeletionAdapter( - database, - 'mail', - ['rowid'], - (Mail item) => - {'rowid': item.id, 'text': item.text}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _mailInsertionAdapter; - - final UpdateAdapter _mailUpdateAdapter; - - final DeletionAdapter _mailDeletionAdapter; - - @override - Future findMailById(int id) async { - return _queryAdapter.query('SELECT * FROM mail WHERE rowid = ?1', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - arguments: [id]); - } - - @override - Future> findMailByKey(String key) async { - return _queryAdapter.queryList('SELECT * FROM mail WHERE text match ?1', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - arguments: [key]); - } - - @override - Future> findAllMails() async { - return _queryAdapter.queryList('SELECT * FROM mail', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String)); - } - - @override - Stream> findAllMailsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM mail', - mapper: (Map row) => - Mail(row['rowid'] as int, row['text'] as String), - queryableName: 'mail', - isView: false); - } - - @override - Future insertMail(Mail mailInfo) async { - await _mailInsertionAdapter.insert(mailInfo, OnConflictStrategy.abort); - } - - @override - Future insertMails(List mailInfo) async { - await _mailInsertionAdapter.insertList(mailInfo, OnConflictStrategy.abort); - } - - @override - Future updateMail(Mail mailInfo) async { - await _mailUpdateAdapter.update(mailInfo, OnConflictStrategy.abort); - } - - @override - Future updateMails(List mailInfo) async { - await _mailUpdateAdapter.updateList(mailInfo, OnConflictStrategy.abort); - } - - @override - Future deleteMail(Mail mailInfo) async { - await _mailDeletionAdapter.delete(mailInfo); - } - - @override - Future deleteMails(List mailInfo) async { - await _mailDeletionAdapter.deleteList(mailInfo); - } -} diff --git a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart b/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart deleted file mode 100644 index 58c86590..00000000 --- a/floor_common/test/integration/inheritance/dao_inheritance_test.g.dart +++ /dev/null @@ -1,144 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'dao_inheritance_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Person` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _personInsertionAdapter = InsertionAdapter( - database, - 'Person', - (Person item) => - {'id': item.id, 'name': item.name}); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM Person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int, row['name'] as String), - arguments: [id]); - } - - @override - Future insertItem(Person item) async { - await _personInsertionAdapter.insert(item, OnConflictStrategy.abort); - } -} diff --git a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart b/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart deleted file mode 100644 index 2de28d1f..00000000 --- a/floor_common/test/integration/inheritance/entity_inheritance_test.g.dart +++ /dev/null @@ -1,170 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'entity_inheritance_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $TestDatabaseBuilderContract { - /// Adds migrations to the builder. - $TestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $TestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract databaseBuilder(String name) => - _$TestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $TestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$TestDatabaseBuilder(null); -} - -class _$TestDatabaseBuilder implements $TestDatabaseBuilderContract { - _$TestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $TestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $TestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$TestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$TestDatabase extends TestDatabase { - _$TestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - CommentDao? _commentDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `comments` (`author` TEXT NOT NULL, `content` TEXT NOT NULL, `id` INTEGER NOT NULL, `create_time` TEXT NOT NULL, `update_time` TEXT, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - CommentDao get commentDao { - return _commentDaoInstance ??= _$CommentDao(database, changeListener); - } -} - -class _$CommentDao extends CommentDao { - _$CommentDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _commentInsertionAdapter = InsertionAdapter( - database, - 'comments', - (Comment item) => { - 'author': item.author, - 'content': item.content, - 'id': item.id, - 'create_time': item.createTime, - 'update_time': item.updateTime - }), - _commentDeletionAdapter = DeletionAdapter( - database, - 'comments', - ['id'], - (Comment item) => { - 'author': item.author, - 'content': item.content, - 'id': item.id, - 'create_time': item.createTime, - 'update_time': item.updateTime - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _commentInsertionAdapter; - - final DeletionAdapter _commentDeletionAdapter; - - @override - Future findCommentById(int id) async { - return _queryAdapter.query('SELECT * FROM comments WHERE id = ?1', - mapper: (Map row) => Comment( - row['id'] as int, row['author'] as String, - content: row['content'] as String, - createTime: row['create_time'] as String?, - updateTime: row['update_time'] as String?), - arguments: [id]); - } - - @override - Future addComment(Comment c) async { - await _commentInsertionAdapter.insert(c, OnConflictStrategy.abort); - } - - @override - Future removeComment(Comment c) async { - await _commentDeletionAdapter.delete(c); - } -} diff --git a/floor_common/test/integration/type_converter/order_database.g.dart b/floor_common/test/integration/type_converter/order_database.g.dart deleted file mode 100644 index 3746ee41..00000000 --- a/floor_common/test/integration/type_converter/order_database.g.dart +++ /dev/null @@ -1,166 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'order_database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $OrderDatabaseBuilderContract { - /// Adds migrations to the builder. - $OrderDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $OrderDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorOrderDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $OrderDatabaseBuilderContract databaseBuilder(String name) => - _$OrderDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $OrderDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$OrderDatabaseBuilder(null); -} - -class _$OrderDatabaseBuilder implements $OrderDatabaseBuilderContract { - _$OrderDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $OrderDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $OrderDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$OrderDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$OrderDatabase extends OrderDatabase { - _$OrderDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - OrderDao? _orderDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `Order` (`id` INTEGER NOT NULL, `date` INTEGER NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - OrderDao get orderDao { - return _orderDaoInstance ??= _$OrderDao(database, changeListener); - } -} - -class _$OrderDao extends OrderDao { - _$OrderDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _orderInsertionAdapter = InsertionAdapter( - database, - 'Order', - (Order item) => { - 'id': item.id, - 'date': _dateTimeConverter.encode(item.date) - }); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _orderInsertionAdapter; - - @override - Future> findOrdersByDate(DateTime date) async { - return _queryAdapter.queryList('SELECT * FROM `Order` WHERE date = ?1', - mapper: (Map row) => Order( - row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), - arguments: [_dateTimeConverter.encode(date)]); - } - - @override - Future> findOrdersByDates(List dates) async { - const offset = 1; - final _sqliteVariablesForDates = - Iterable.generate(dates.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM `Order` WHERE date IN (' + - _sqliteVariablesForDates + - ')', - mapper: (Map row) => Order( - row['id'] as int, _dateTimeConverter.decode(row['date'] as int)), - arguments: [ - ...dates.map((element) => _dateTimeConverter.encode(element)) - ]); - } - - @override - Future insertOrder(Order order) async { - await _orderInsertionAdapter.insert(order, OnConflictStrategy.abort); - } -} - -// ignore_for_file: unused_element -final _dateTimeConverter = DateTimeConverter(); diff --git a/floor_common/test/integration/view/view_test.g.dart b/floor_common/test/integration/view/view_test.g.dart deleted file mode 100644 index b168d05e..00000000 --- a/floor_common/test/integration/view/view_test.g.dart +++ /dev/null @@ -1,521 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'view_test.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -abstract class $ViewTestDatabaseBuilderContract { - /// Adds migrations to the builder. - $ViewTestDatabaseBuilderContract addMigrations(List migrations); - - /// Adds a database [Callback] to the builder. - $ViewTestDatabaseBuilderContract addCallback(Callback callback); - - /// Creates the database and initializes it. - Future build(); -} - -// ignore: avoid_classes_with_only_static_members -class $FloorViewTestDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static $ViewTestDatabaseBuilderContract databaseBuilder(String name) => - _$ViewTestDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static $ViewTestDatabaseBuilderContract inMemoryDatabaseBuilder() => - _$ViewTestDatabaseBuilder(null); -} - -class _$ViewTestDatabaseBuilder implements $ViewTestDatabaseBuilderContract { - _$ViewTestDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - @override - $ViewTestDatabaseBuilderContract addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - @override - $ViewTestDatabaseBuilderContract addCallback(Callback callback) { - _callback = callback; - return this; - } - - @override - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$ViewTestDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$ViewTestDatabase extends ViewTestDatabase { - _$ViewTestDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - PersonDao? _personDaoInstance; - - DogDao? _dogDaoInstance; - - NameDao? _nameDaoInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER, `custom_name` TEXT NOT NULL, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE TABLE IF NOT EXISTS `dog` (`id` INTEGER, `name` TEXT NOT NULL, `nick_name` TEXT NOT NULL, `owner_id` INTEGER NOT NULL, FOREIGN KEY (`owner_id`) REFERENCES `person` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE, PRIMARY KEY (`id`))'); - await database.execute( - 'CREATE INDEX `index_person_custom_name` ON `person` (`custom_name`)'); - await database.execute( - 'CREATE VIEW IF NOT EXISTS `names` AS SELECT custom_name as name FROM person UNION SELECT name from dog'); - await database.execute( - 'CREATE VIEW IF NOT EXISTS `multiline_query_names` AS SELECT custom_name as name \n FROM person \n UNION SELECT name from dog\n '); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - PersonDao get personDao { - return _personDaoInstance ??= _$PersonDao(database, changeListener); - } - - @override - DogDao get dogDao { - return _dogDaoInstance ??= _$DogDao(database, changeListener); - } - - @override - NameDao get nameDao { - return _nameDaoInstance ??= _$NameDao(database, changeListener); - } -} - -class _$PersonDao extends PersonDao { - _$PersonDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _personInsertionAdapter = InsertionAdapter( - database, - 'person', - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personUpdateAdapter = UpdateAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener), - _personDeletionAdapter = DeletionAdapter( - database, - 'person', - ['id'], - (Person item) => - {'id': item.id, 'custom_name': item.name}, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _personInsertionAdapter; - - final UpdateAdapter _personUpdateAdapter; - - final DeletionAdapter _personDeletionAdapter; - - @override - Future> findAllPersons() async { - return _queryAdapter.queryList('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Stream> findAllPersonsAsStream() { - return _queryAdapter.queryListStream('SELECT * FROM person', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - queryableName: 'person', - isView: false); - } - - @override - Future findPersonById(int id) async { - return _queryAdapter.query('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id]); - } - - @override - Stream findPersonByIdAsStream(int id) { - return _queryAdapter.queryStream('SELECT * FROM person WHERE id = ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id], - queryableName: 'person', - isView: false); - } - - @override - Stream uniqueRecordsCountAsStream() { - return _queryAdapter.queryStream('SELECT DISTINCT COUNT(id) FROM person', - mapper: (Map row) => row.values.first as int, - queryableName: 'person', - isView: false); - } - - @override - Future findPersonByIdAndName( - int id, - String name, - ) async { - return _queryAdapter.query( - 'SELECT * FROM person WHERE id = ?1 AND custom_name = ?2', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [id, name]); - } - - @override - Future> findPersonsWithIds(List ids) async { - const offset = 1; - final _sqliteVariablesForIds = - Iterable.generate(ids.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE id IN (' + _sqliteVariablesForIds + ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...ids]); - } - - @override - Future> findPersonsWithNames(List names) async { - const offset = 1; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ')', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [...names]); - } - - @override - Future> findPersonsWithNamesComplex( - int reference, - List names, - List moreNames, - ) async { - int offset = 2; - final _sqliteVariablesForNames = - Iterable.generate(names.length, (i) => '?${i + offset}') - .join(','); - offset += names.length; - final _sqliteVariablesForMoreNames = - Iterable.generate(moreNames.length, (i) => '?${i + offset}') - .join(','); - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name IN (' + - _sqliteVariablesForNames + - ') AND id>=?1 OR custom_name IN (' + - _sqliteVariablesForMoreNames + - ') AND id<=?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [reference, ...names, ...moreNames]); - } - - @override - Future> findPersonsWithNamesLike(String name) async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name LIKE ?1', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String), - arguments: [name]); - } - - @override - Future> findPersonsWithEmptyName() async { - return _queryAdapter.queryList( - 'SELECT * FROM person WHERE custom_name == \'\'', - mapper: (Map row) => - Person(row['id'] as int?, row['custom_name'] as String)); - } - - @override - Future deleteAllPersons() async { - await _queryAdapter.queryNoReturn('DELETE FROM person'); - } - - @override - Stream> findAllDogsOfPersonAsStream(int id) { - return _queryAdapter.queryListStream( - 'SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id], - queryableName: 'dog', - isView: false); - } - - @override - Future insertPerson(Person person) async { - await _personInsertionAdapter.insert(person, OnConflictStrategy.replace); - } - - @override - Future insertPersons(List persons) async { - await _personInsertionAdapter.insertList(persons, OnConflictStrategy.abort); - } - - @override - Future insertPersonWithReturn(Person person) { - return _personInsertionAdapter.insertAndReturnId( - person, OnConflictStrategy.abort); - } - - @override - Future> insertPersonsWithReturn(List persons) { - return _personInsertionAdapter.insertListAndReturnIds( - persons, OnConflictStrategy.abort); - } - - @override - Future updatePerson(Person person) async { - await _personUpdateAdapter.update(person, OnConflictStrategy.abort); - } - - @override - Future updatePersons(List persons) async { - await _personUpdateAdapter.updateList(persons, OnConflictStrategy.abort); - } - - @override - Future updatePersonWithReturn(Person person) { - return _personUpdateAdapter.updateAndReturnChangedRows( - person, OnConflictStrategy.abort); - } - - @override - Future updatePersonsWithReturn(List persons) { - return _personUpdateAdapter.updateListAndReturnChangedRows( - persons, OnConflictStrategy.abort); - } - - @override - Future deletePerson(Person person) async { - await _personDeletionAdapter.delete(person); - } - - @override - Future deletePersons(List person) async { - await _personDeletionAdapter.deleteList(person); - } - - @override - Future deletePersonWithReturn(Person person) { - return _personDeletionAdapter.deleteAndReturnChangedRows(person); - } - - @override - Future deletePersonsWithReturn(List persons) { - return _personDeletionAdapter.deleteListAndReturnChangedRows(persons); - } - - @override - Future replacePersons(List persons) async { - if (database is sqflite.Transaction) { - await super.replacePersons(persons); - } else { - await (database as sqflite.Database) - .transaction((transaction) async { - final transactionDatabase = _$ViewTestDatabase(changeListener) - ..database = transaction; - await transactionDatabase.personDao.replacePersons(persons); - }); - } - } - - @override - Future> replacePersonsAndReturn(List persons) async { - if (database is sqflite.Transaction) { - return super.replacePersonsAndReturn(persons); - } else { - return (database as sqflite.Database) - .transaction>((transaction) async { - final transactionDatabase = _$ViewTestDatabase(changeListener) - ..database = transaction; - return transactionDatabase.personDao.replacePersonsAndReturn(persons); - }); - } - } -} - -class _$DogDao extends DogDao { - _$DogDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database), - _dogInsertionAdapter = InsertionAdapter( - database, - 'dog', - (Dog item) => { - 'id': item.id, - 'name': item.name, - 'nick_name': item.nickName, - 'owner_id': item.ownerId - }, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _dogInsertionAdapter; - - @override - Future findDogForPersonId(int id) async { - return _queryAdapter.query('SELECT * FROM dog WHERE owner_id = ?1', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int), - arguments: [id]); - } - - @override - Future> findAllDogs() async { - return _queryAdapter.queryList('SELECT * FROM dog', - mapper: (Map row) => Dog( - row['id'] as int?, - row['name'] as String, - row['nick_name'] as String, - row['owner_id'] as int)); - } - - @override - Future insertDog(Dog dog) async { - await _dogInsertionAdapter.insert(dog, OnConflictStrategy.abort); - } -} - -class _$NameDao extends NameDao { - _$NameDao( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - @override - Future> findAllNames() async { - return _queryAdapter.queryList('SELECT * FROM names ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String)); - } - - @override - Stream> findAllNamesAsStream() { - return _queryAdapter.queryListStream( - 'SELECT * FROM names ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - queryableName: 'names', - isView: true); - } - - @override - Future findExactName(String name) async { - return _queryAdapter.query('SELECT * FROM names WHERE name = ?1', - mapper: (Map row) => Name(row['name'] as String), - arguments: [name]); - } - - @override - Future> findNamesLike(String suffix) async { - return _queryAdapter.queryList( - 'SELECT * FROM names WHERE name LIKE ?1 ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - arguments: [suffix]); - } - - @override - Future> findNamesMatchingBoth( - String prefix, - String suffix, - ) async { - return _queryAdapter.queryList( - 'SELECT * FROM names WHERE name LIKE ?2 AND name LIKE ?1 ORDER BY name ASC', - mapper: (Map row) => Name(row['name'] as String), - arguments: [prefix, suffix]); - } - - @override - Future findMultilineQueryName(String name) async { - return _queryAdapter.query( - 'SELECT * FROM multiline_query_names WHERE name = ?1', - mapper: (Map row) => - MultilineQueryName(row['name'] as String), - arguments: [name]); - } -} From 62661ecff27cf3104a9b1eaadfc1679aa77f8c4f Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 11:44:22 +0200 Subject: [PATCH 17/22] Change test command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7fa4ff9..e83ed5ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - name: Run tests working-directory: floor_generator - run: dart run test_cov + run: flutter test --coverage --coverage-path coverage/lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 8658bf3344829a726fee62c1327700f1a3676c91 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 11:47:31 +0200 Subject: [PATCH 18/22] Change test command from flutter to dart --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e83ed5ea..11943a59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - name: Run tests working-directory: floor_generator - run: flutter test --coverage --coverage-path coverage/lcov.info + run: dart test --coverage --coverage-path coverage/lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From f97367d35d25deb6f8f742f9cda54987ec8d9c63 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 11:57:35 +0200 Subject: [PATCH 19/22] Change test command --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11943a59..b3fefb98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,15 @@ jobs: - name: Run tests working-directory: floor_generator - run: dart test --coverage --coverage-path coverage/lcov.info + run: dart run test_cov - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 + working-directory: floor_generator with: token: ${{ secrets.CODECOV_TOKEN }} flags: floor_generator - file: ./floor_generator/coverage/lcov.info + file: ./coverage/lcov.info floor: runs-on: ${{ matrix.os }} From 3e71e4e65552cd2511c08f1e16f234a5c37c5a7c Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 12:04:38 +0200 Subject: [PATCH 20/22] empty commit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3fefb98..f8cbc015 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: working-directory: floor_generator with: token: ${{ secrets.CODECOV_TOKEN }} - flags: floor_generator + flags: floor_generatorh file: ./coverage/lcov.info floor: From a3b881a57686d44d7f3aa31b031131409d1c4514 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 12:05:06 +0200 Subject: [PATCH 21/22] empty commit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8cbc015..b3fefb98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: working-directory: floor_generator with: token: ${{ secrets.CODECOV_TOKEN }} - flags: floor_generatorh + flags: floor_generator file: ./coverage/lcov.info floor: From 435813a4c778711d520d84927924d016430c86a7 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Tue, 30 Apr 2024 12:07:23 +0200 Subject: [PATCH 22/22] rollback ci.yml --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3fefb98..c7fa4ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,11 +59,10 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 - working-directory: floor_generator with: token: ${{ secrets.CODECOV_TOKEN }} flags: floor_generator - file: ./coverage/lcov.info + file: ./floor_generator/coverage/lcov.info floor: runs-on: ${{ matrix.os }}