mirror of https://github.com/AMT-Cheif/drift.git
Move generator to drift_dev
This commit is contained in:
parent
40e7ff3f45
commit
fcbef06b7c
|
@ -0,0 +1,15 @@
|
|||
include: ../analysis_options.yaml
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
public_member_api_docs: warning
|
||||
deprecated_member_use_from_same_package: ignore
|
||||
exclude:
|
||||
- "example_web/**"
|
||||
- "**/*.g.dart"
|
||||
- "**/*.mocks.dart"
|
||||
|
||||
linter:
|
||||
rules:
|
||||
# todo: Re-enable after https://dart-review.googlesource.com/c/sdk/+/204040 lands on beta
|
||||
comment_references: false
|
|
@ -20,7 +20,7 @@ dependencies:
|
|||
dev_dependencies:
|
||||
build_test: ^2.0.0
|
||||
build_runner_core: ^7.0.0
|
||||
moor_generator: any
|
||||
drift_dev: any
|
||||
uuid: ^3.0.0
|
||||
path: ^1.8.0
|
||||
build_runner: ^2.0.0
|
||||
|
@ -29,7 +29,7 @@ dev_dependencies:
|
|||
rxdart: ^0.27.0
|
||||
|
||||
dependency_overrides:
|
||||
moor_generator:
|
||||
path: ../moor_generator
|
||||
drift_dev:
|
||||
path: ../drift_dev
|
||||
sqlparser:
|
||||
path: ../sqlparser
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 Simon Binder
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1 @@
|
|||
include: ../analysis_options.yaml
|
|
@ -0,0 +1,6 @@
|
|||
//@dart=2.9
|
||||
import 'package:drift_dev/src/cli/cli.dart' as cli;
|
||||
|
||||
Future main(List<String> args) {
|
||||
return cli.run(args);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
# Short description for each builder
|
||||
|
||||
# - preparing_builder: Infers the type of inline Dart expressions in moor files.
|
||||
# We create a `input.temp.dart` file containing the expressions so that they
|
||||
# can be resolved.
|
||||
# - moor_generator: The regular SharedPartBuilder for @UseMoor and @UseDao
|
||||
# annotations
|
||||
# - moor_generator_not_shared: Like moor_generator, but as a PartBuilder instead of
|
||||
# a SharedPartBuilder. This builder is disabled by default, but users may choose
|
||||
# to use it so that generated classes can be used by other builders.
|
||||
# - moor_cleanup: Deletes the `.temp.dart` files generated by the `preparing_builder`.
|
||||
|
||||
builders:
|
||||
preparing_builder:
|
||||
import: "package:drift_dev/integrations/build.dart"
|
||||
builder_factories: ["preparingBuilder"]
|
||||
build_extensions: {".moor": [".temp.dart", ".dart_in_moor"]}
|
||||
build_to: cache
|
||||
auto_apply: dependents
|
||||
applies_builders: ["moor_generator|moor_cleanup"]
|
||||
|
||||
moor_generator:
|
||||
import: "package:drift_dev/integrations/build.dart"
|
||||
builder_factories: ["moorBuilder"]
|
||||
build_extensions: {".dart": [".moor.g.part"]}
|
||||
auto_apply: dependents
|
||||
build_to: cache
|
||||
required_inputs: [".dart_in_moor"]
|
||||
applies_builders: ["source_gen|combining_builder"]
|
||||
|
||||
moor_generator_not_shared:
|
||||
import: "package:drift_dev/integrations/build.dart"
|
||||
builder_factories: ["moorBuilderNotShared"]
|
||||
build_extensions: {".dart": [".moor.dart"]}
|
||||
build_to: source
|
||||
auto_apply: none
|
||||
required_inputs: [".dart_in_moor"]
|
||||
|
||||
post_process_builders:
|
||||
moor_cleanup:
|
||||
import: "package:drift_dev/integrations/build.dart"
|
||||
builder_factory: "moorCleanup"
|
|
@ -0,0 +1,4 @@
|
|||
tags:
|
||||
# Tests that spawn a Dart analyzer
|
||||
analyzer:
|
||||
timeout: 4x # the analyzer can be slow
|
|
@ -1,3 +1,3 @@
|
|||
# Build config without moor-specific builders. When running a build in this directory, this file replaces build.yaml,
|
||||
# Build config without drift-specific builders. When running a build in this directory, this file replaces build.yaml,
|
||||
# which is what we want! Our builders depend on generated code, so they break the generated build script at the start of
|
||||
# a build.
|
|
@ -0,0 +1,167 @@
|
|||
import 'package:meta/meta.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
|
||||
import 'package:drift_dev/src/services/schema/verifier_impl.dart';
|
||||
import 'package:sqlite3/sqlite3.dart';
|
||||
|
||||
abstract class SchemaVerifier {
|
||||
factory SchemaVerifier(SchemaInstantiationHelper helper) =
|
||||
VerifierImplementation;
|
||||
|
||||
/// Creates a [DatabaseConnection] that contains empty tables created for the
|
||||
/// known schema [version].
|
||||
///
|
||||
/// This is useful as a starting point for a schema migration test. You can
|
||||
/// use the [DatabaseConnection] returned to create an instance of your
|
||||
/// application database, which can then be migrated through
|
||||
/// [migrateAndValidate].
|
||||
///
|
||||
/// If you want to insert data in a migration test, use [schemaAt].
|
||||
Future<DatabaseConnection> startAt(int version);
|
||||
|
||||
/// Creates a new database and instantiates the schema with the given
|
||||
/// [version].
|
||||
///
|
||||
/// This can be used as a starting point for a complex schema migration test
|
||||
/// to verify data integrity. You can roughly follow these steps to write such
|
||||
/// tests:
|
||||
///
|
||||
/// - call [schemaAt] with the starting version you want to test
|
||||
/// - use the [InitializedSchema.rawDatabase] of the returned
|
||||
/// [InitializedSchema] to insert data.
|
||||
/// - connect your database class to the [InitializedSchema.connection]
|
||||
/// - call [migrateAndValidate] with the database and your target schema
|
||||
/// version to run a migration and verify that it yields the desired schema
|
||||
/// when done.
|
||||
/// - run select statements on your database to verify that the data from
|
||||
/// step 2 hasn't been affected by the migration.
|
||||
///
|
||||
/// If you only want to verify the schema without data, using [startAt] might
|
||||
/// be easier.
|
||||
Future<InitializedSchema> schemaAt(int version);
|
||||
|
||||
/// Runs a schema migration and verifies that it transforms the database into
|
||||
/// a correct state.
|
||||
///
|
||||
/// This involves opening the [db] and calling its
|
||||
/// [GeneratedDatabase.migration] to migrate it to the latest version.
|
||||
/// Finally, the method will read from `sqlite_schema` to verify that the
|
||||
/// schema at runtime matches the expected schema version.
|
||||
///
|
||||
/// The future completes normally if the schema migration succeeds and brings
|
||||
/// the database into the expected schema. If the comparison fails, a
|
||||
/// [SchemaMismatch] exception will be thrown.
|
||||
///
|
||||
/// If [validateDropped] is enabled (defaults to `false`), the method also
|
||||
/// validates that no further tables, triggers or views apart from those
|
||||
/// expected exist.
|
||||
Future<void> migrateAndValidate(GeneratedDatabase db, int expectedVersion,
|
||||
{bool validateDropped = false});
|
||||
}
|
||||
|
||||
/// The implementation of this class is generated through the `moor_generator`
|
||||
/// CLI tool.
|
||||
abstract class SchemaInstantiationHelper {
|
||||
GeneratedDatabase databaseForVersion(QueryExecutor db, int version);
|
||||
}
|
||||
|
||||
/// Thrown when trying to instantiate a schema that hasn't been saved.
|
||||
class MissingSchemaException implements Exception {
|
||||
/// The requested version that doesn't exist.
|
||||
final int requested;
|
||||
|
||||
/// All known schema versions.
|
||||
final Iterable<int> available;
|
||||
|
||||
MissingSchemaException(this.requested, this.available);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Unknown schema version $requested. '
|
||||
'Known are ${available.join(', ')}.';
|
||||
}
|
||||
}
|
||||
|
||||
/// Thrown when the actual schema differs from the expected schema.
|
||||
class SchemaMismatch implements Exception {
|
||||
final String explanation;
|
||||
|
||||
SchemaMismatch(this.explanation);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Schema does not match\n$explanation';
|
||||
}
|
||||
}
|
||||
|
||||
/// Contains an initialized schema with all tables, views, triggers and indices.
|
||||
///
|
||||
/// You can use the [connection] for your database class and the [rawDatabase]
|
||||
/// to insert data before the migration.
|
||||
class InitializedSchema {
|
||||
/// The raw database from the `sqlite3` package.
|
||||
///
|
||||
/// The database contains all tables, views, triggers and indices from the
|
||||
/// requested schema. It can be used to insert data before a migration to
|
||||
/// verify that it's still intact after the migration.
|
||||
///
|
||||
/// This database backs the [connection], so it's not necessary to close it
|
||||
/// if you're attaching a database later.
|
||||
final Database rawDatabase;
|
||||
|
||||
final DatabaseConnection Function() _createConnection;
|
||||
|
||||
/// A database connection with a prepared schema.
|
||||
///
|
||||
/// You can connect your database classes to this as a starting point for
|
||||
/// migration tests.
|
||||
@Deprecated('Use newConnection instead, and store the result')
|
||||
late final DatabaseConnection connection = _createConnection();
|
||||
|
||||
@internal
|
||||
InitializedSchema(this.rawDatabase, this._createConnection);
|
||||
|
||||
/// Creates a new database connection.
|
||||
///
|
||||
/// All connections returned by this method point to the [rawDatabase].
|
||||
/// However, each call to [newConnection] returns an independent connection
|
||||
/// that is considered closed from moor's point of view. This means that the
|
||||
/// [rawDatabase] can be used by multiple generated database classes that
|
||||
/// can independently be opened and closed, albeit not simultaneously.
|
||||
///
|
||||
/// ## Example
|
||||
///
|
||||
/// When generating the schema helpers with the `--data-classes` and the
|
||||
/// `--companions` command-line flags, this method can be used to create moor
|
||||
/// databases inserting data at specific versions:
|
||||
///
|
||||
/// ```dart
|
||||
/// import 'generated/schema.dart';
|
||||
/// import 'generated/schema_v1.dart' as v1;
|
||||
/// import 'generated/schema_v2.dart' as v2;
|
||||
///
|
||||
/// test('data integrity from v1 to v2', () async {
|
||||
/// final verifier = SchemaVerifier(GeneratedHelper());
|
||||
/// final schema = await verifier.schemaAt(1);
|
||||
///
|
||||
/// // Insert some data from the view of the old database on an independent
|
||||
/// // connection!
|
||||
/// final oldDb = v1.DatabaseAtV1.connect(schema.newConnection());
|
||||
/// await oldDb.into(oldDb.users).insert(v1.UsersCompanion(id: Value(1)));
|
||||
/// await oldDb.close();
|
||||
///
|
||||
/// // Run the migration on the real database class from your app
|
||||
/// final dbForMigration = Database(schema.newConnection());
|
||||
/// await verifier.migrateAndValidate(dbForMigration, 2);
|
||||
/// await dbForMigration.close();
|
||||
///
|
||||
/// // Make sure the user is still here with a new database at v2
|
||||
/// final checkDb = v2.DatabaseAtV2.connect(schema.newConnection());
|
||||
/// final user = await checkDb.select(checkDb.users).getSingle();
|
||||
/// expect(user.id, 1);
|
||||
/// expect(user.name, 'default name from migration');
|
||||
/// await checkDb.close();
|
||||
/// });
|
||||
/// ```
|
||||
DatabaseConnection newConnection() => _createConnection();
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:drift_dev/src/backends/build/moor_builder.dart';
|
||||
import 'package:drift_dev/src/backends/build/preprocess_builder.dart';
|
||||
|
||||
Builder moorBuilder(BuilderOptions options) => MoorSharedPartBuilder(options);
|
||||
|
||||
Builder moorBuilderNotShared(BuilderOptions options) =>
|
||||
MoorPartBuilder(options);
|
||||
|
||||
Builder preparingBuilder(BuilderOptions options) => PreprocessBuilder();
|
||||
|
||||
PostProcessBuilder moorCleanup(BuilderOptions options) {
|
||||
return const FileDeletingBuilder(['.temp.dart']);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
//@dart=2.9
|
||||
import 'dart:isolate';
|
||||
|
||||
import 'package:analyzer_plugin/starter.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/plugin.dart';
|
||||
|
||||
void start(List<String> args, SendPort sendPort) {
|
||||
ServerPluginStarter(MoorPlugin.forProduction()).start(sendPort);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export 'src/model/model.dart';
|
|
@ -2,8 +2,8 @@ import 'package:analyzer/dart/element/element.dart';
|
|||
import 'package:analyzer/dart/element/nullability_suffix.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:analyzer/dart/element/type_provider.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
|
||||
class FoundDartClass {
|
||||
final ClassElement classElement;
|
|
@ -5,13 +5,13 @@ import 'package:analyzer/dart/element/type.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:moor/sqlite_keywords.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/model/declarations/declaration.dart';
|
||||
import 'package:moor_generator/src/model/used_type_converter.dart';
|
||||
import 'package:moor_generator/src/utils/names.dart';
|
||||
import 'package:moor_generator/src/utils/type_utils.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/model/declarations/declaration.dart';
|
||||
import 'package:drift_dev/src/model/used_type_converter.dart';
|
||||
import 'package:drift_dev/src/utils/names.dart';
|
||||
import 'package:drift_dev/src/utils/type_utils.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
import 'package:analyzer/dart/element/nullability_suffix.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
import 'package:moor_generator/src/model/declarations/declaration.dart';
|
||||
import 'package:moor_generator/src/model/used_type_converter.dart';
|
||||
import 'package:moor_generator/src/utils/names.dart';
|
||||
import 'package:moor_generator/src/utils/string_escaper.dart';
|
||||
import 'package:moor_generator/src/utils/type_converter_hint.dart';
|
||||
import 'package:moor_generator/src/utils/type_utils.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:drift_dev/src/backends/backend.dart';
|
||||
import 'package:drift_dev/src/model/declarations/declaration.dart';
|
||||
import 'package:drift_dev/src/model/used_type_converter.dart';
|
||||
import 'package:drift_dev/src/utils/names.dart';
|
||||
import 'package:drift_dev/src/utils/string_escaper.dart';
|
||||
import 'package:drift_dev/src/utils/type_converter_hint.dart';
|
||||
import 'package:drift_dev/src/utils/type_utils.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
import 'package:sqlparser/utils/find_referenced_tables.dart';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/backends/backend.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import '../custom_row_class.dart';
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/moor/create_table_reader.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/create_table_reader.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
class MoorParser {
|
|
@ -1,7 +1,7 @@
|
|||
import 'dart:collection';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
|
||||
import '../errors.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/model/view.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/src/model/view.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
abstract class FileResult {
|
|
@ -2,21 +2,21 @@ import 'package:analyzer/dart/constant/value.dart';
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/dart/parser.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/moor/entity_handler.dart';
|
||||
import 'package:moor_generator/src/analyzer/moor/parser.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/task.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/custom_result_class.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:moor_generator/src/analyzer/view/view_analyzer.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/model/view.dart';
|
||||
import 'package:moor_generator/src/utils/entity_reference_sorter.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/dart/parser.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/entity_handler.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/parser.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/task.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/custom_result_class.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:drift_dev/src/analyzer/view/view_analyzer.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/src/model/view.dart';
|
||||
import 'package:drift_dev/src/utils/entity_reference_sorter.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
part 'steps/analyze_dart.dart';
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/analyzer/session.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/analyzer/session.dart';
|
||||
import 'package:drift_dev/src/backends/backend.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
/// A task is used to fully parse and analyze files based on an input file. To
|
|
@ -1,10 +1,10 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/moor/moor_ffi_extension.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/task.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/moor_ffi_extension.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/task.dart';
|
||||
import 'package:drift_dev/src/backends/backend.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
|
||||
/// Transforms queries accessible to the [accessor] so that they use custom
|
||||
/// result names.
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:moor_generator/moor_generator.dart' show MoorColumn;
|
||||
import 'package:drift_dev/moor_generator.dart' show MoorColumn;
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import '../query_handler.dart';
|
|
@ -1,14 +1,14 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/lints/linter.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/query_handler.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/model/view.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/lints/linter.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/query_handler.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/src/model/view.dart';
|
||||
import 'package:sqlparser/sqlparser.dart' hide ResultColumn;
|
||||
import 'package:sqlparser/utils/find_referenced_tables.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/model/used_type_converter.dart';
|
||||
import 'package:moor_generator/src/utils/type_converter_hint.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/type_mapping.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/src/model/used_type_converter.dart';
|
||||
import 'package:drift_dev/src/utils/type_converter_hint.dart';
|
||||
import 'package:sqlparser/sqlparser.dart' hide ResultColumn;
|
||||
import 'package:sqlparser/utils/find_referenced_tables.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:moor/moor.dart' as m;
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/model/view.dart';
|
||||
import 'package:moor_generator/src/utils/type_converter_hint.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/src/model/view.dart';
|
||||
import 'package:drift_dev/src/utils/type_converter_hint.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
import 'package:sqlparser/utils/find_referenced_tables.dart' as s;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/moor/find_dart_class.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/steps.dart';
|
||||
import 'package:moor_generator/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:moor_generator/src/model/table.dart';
|
||||
import 'package:moor_generator/src/model/view.dart';
|
||||
import 'package:moor_generator/src/utils/type_converter_hint.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/find_dart_class.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/steps.dart';
|
||||
import 'package:drift_dev/src/analyzer/sql_queries/query_analyzer.dart';
|
||||
import 'package:drift_dev/src/model/table.dart';
|
||||
import 'package:drift_dev/src/model/view.dart';
|
||||
import 'package:drift_dev/src/utils/type_converter_hint.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -5,8 +5,8 @@ import 'package:analyzer/dart/element/type.dart';
|
|||
import 'package:build/build.dart' hide log;
|
||||
import 'package:build/build.dart' as build show log;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/backends/backend.dart';
|
||||
|
||||
class BuildBackend extends Backend {
|
||||
final MoorOptions options;
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/backends/build/moor_builder.dart';
|
||||
import 'package:moor_generator/src/utils/type_utils.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/backends/build/moor_builder.dart';
|
||||
import 'package:drift_dev/src/utils/type_utils.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
class DaoGenerator extends Generator implements BaseGenerator {
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:moor_generator/src/backends/build/moor_builder.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/src/backends/build/moor_builder.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
const _ignoredLints = [
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/task.dart';
|
||||
import 'package:moor_generator/src/analyzer/session.dart';
|
||||
import 'package:moor_generator/src/backends/build/build_backend.dart';
|
||||
import 'package:moor_generator/src/backends/build/generators/dao_generator.dart';
|
||||
import 'package:moor_generator/src/backends/build/generators/moor_generator.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/task.dart';
|
||||
import 'package:drift_dev/src/analyzer/session.dart';
|
||||
import 'package:drift_dev/src/backends/build/build_backend.dart';
|
||||
import 'package:drift_dev/src/backends/build/generators/dao_generator.dart';
|
||||
import 'package:drift_dev/src/backends/build/generators/moor_generator.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
class _BuilderFlags {
|
|
@ -2,7 +2,7 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:build/build.dart';
|
||||
import 'package:moor_generator/src/utils/string_escaper.dart';
|
||||
import 'package:drift_dev/src/utils/string_escaper.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
/// A support builder that runs before the main moor_generator to parse and
|
|
@ -8,10 +8,10 @@ import 'package:analyzer/file_system/overlay_file_system.dart';
|
|||
// ignore: implementation_imports
|
||||
import 'package:drift/src/utils/synchronized.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/session.dart';
|
||||
import 'package:moor_generator/src/utils/options_reader.dart' as options;
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/session.dart';
|
||||
import 'package:drift_dev/src/utils/options_reader.dart' as options;
|
||||
|
||||
import '../standalone.dart';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_generated.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/plugin.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/plugin.dart';
|
||||
|
||||
var _initialized = false;
|
||||
|
|
@ -13,15 +13,15 @@ import 'package:analyzer_plugin/utilities/completion/completion_core.dart';
|
|||
import 'package:analyzer_plugin/utilities/folding/folding.dart';
|
||||
import 'package:analyzer_plugin/utilities/navigation/navigation.dart';
|
||||
import 'package:analyzer_plugin/utilities/outline/outline.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/backends/common/driver.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/autocomplete.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/errors.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/folding.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/navigation.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/outline.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/requests.dart';
|
||||
import 'package:moor_generator/src/services/ide/moor_ide.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/backends/common/driver.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/autocomplete.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/errors.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/folding.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/navigation.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/outline.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/requests.dart';
|
||||
import 'package:drift_dev/src/services/ide/moor_ide.dart';
|
||||
|
||||
import 'logger.dart';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/utilities/completion/completion_core.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/requests.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/requests.dart';
|
||||
|
||||
class MoorCompletingContributor implements CompletionContributor {
|
||||
const MoorCompletingContributor();
|
|
@ -1,9 +1,9 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_generated.dart';
|
||||
import 'package:moor_generator/src/analyzer/errors.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/plugin.dart';
|
||||
import 'package:drift_dev/src/analyzer/errors.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/plugin.dart';
|
||||
|
||||
const _genericError = 'moor.errorGeneric';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/utilities/folding/folding.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/requests.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/requests.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
class MoorFoldingContributor implements FoldingContributor {
|
|
@ -1,10 +1,10 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/utilities/navigation/navigation.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/requests.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/utils/ast_to_location.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/utils/span_utils.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/requests.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/utils/ast_to_location.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/utils/span_utils.dart';
|
||||
import 'package:source_span/source_span.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/utilities/outline/outline.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/services/requests.dart';
|
||||
import 'package:moor_generator/src/backends/plugin/utils/ast_to_location.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/services/requests.dart';
|
||||
import 'package:drift_dev/src/backends/plugin/utils/ast_to_location.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
const _defaultFlags = 0;
|
|
@ -6,8 +6,8 @@ import 'package:analyzer_plugin/utilities/folding/folding.dart';
|
|||
import 'package:analyzer_plugin/utilities/highlights/highlights.dart';
|
||||
import 'package:analyzer_plugin/utilities/navigation/navigation.dart';
|
||||
import 'package:analyzer_plugin/utilities/outline/outline.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:source_span/source_span.dart';
|
||||
|
||||
mixin _MoorBaseRequest {
|
|
@ -1,7 +1,7 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:source_gen/source_gen.dart' show spanForElement;
|
||||
import 'package:source_span/source_span.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
|
@ -5,8 +5,8 @@ import 'dart:io';
|
|||
import 'package:analyzer/file_system/physical_file_system.dart';
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moor_generator/src/backends/common/driver.dart';
|
||||
import 'package:moor_generator/src/cli/project.dart';
|
||||
import 'package:drift_dev/src/backends/common/driver.dart';
|
||||
import 'package:drift_dev/src/cli/project.dart';
|
||||
|
||||
import 'commands/analyze.dart';
|
||||
import 'commands/identify_databases.dart';
|
|
@ -2,7 +2,7 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
import '../cli.dart';
|
|
@ -7,7 +7,7 @@ import 'package:analyzer/dart/analysis/results.dart';
|
|||
import 'package:analyzer/dart/ast/ast.dart';
|
||||
import 'package:analyzer/dart/ast/visitor.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/src/utils/string_escaper.dart';
|
||||
import 'package:drift_dev/src/utils/string_escaper.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:sqlparser/sqlparser.dart' hide AnalysisContext, StringLiteral;
|
||||
import 'package:yaml/yaml.dart';
|
|
@ -1,7 +1,7 @@
|
|||
//@dart=2.9
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:moor_generator/src/cli/commands/schema/dump.dart';
|
||||
import 'package:moor_generator/src/cli/commands/schema/generate_utils.dart';
|
||||
import 'package:drift_dev/src/cli/commands/schema/dump.dart';
|
||||
import 'package:drift_dev/src/cli/commands/schema/generate_utils.dart';
|
||||
|
||||
import '../cli.dart';
|
||||
|
|
@ -3,8 +3,8 @@ import 'dart:convert';
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/services/schema/schema_files.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/services/schema/schema_files.dart';
|
||||
|
||||
import '../../cli.dart';
|
||||
|
|
@ -5,10 +5,10 @@ import 'dart:io';
|
|||
import 'package:analyzer/dart/analysis/features.dart';
|
||||
import 'package:args/command_runner.dart';
|
||||
import 'package:dart_style/dart_style.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/cli/cli.dart';
|
||||
import 'package:moor_generator/src/services/schema/schema_files.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/cli/cli.dart';
|
||||
import 'package:drift_dev/src/services/schema/schema_files.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
import 'package:package_config/package_config.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
|
@ -166,7 +166,7 @@ class GenerateUtilsCommand extends Command {
|
|||
..writeln(_prefix)
|
||||
..writeDartVersion(nnbd)
|
||||
..writeln("import 'package:moor/moor.dart';")
|
||||
..writeln("import 'package:moor_generator/api/migrations.dart';");
|
||||
..writeln("import 'package:drift_dev/api/migrations.dart';");
|
||||
|
||||
for (final version in versions) {
|
||||
buffer.writeln("import '${_filenameForVersion(version)}' as v$version;");
|
|
@ -2,8 +2,8 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:build_config/build_config.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/utils/options_reader.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/utils/options_reader.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:stream_transform/stream_transform.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/nullability_suffix.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
|
||||
/// Some schema entity found.
|
||||
///
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
|
||||
import 'declarations/declaration.dart';
|
||||
import 'types.dart';
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/model/sql_query.dart';
|
||||
|
||||
import 'declarations/declaration.dart';
|
||||
import 'table.dart';
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/model/sources.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/model/sources.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
import 'package:sqlparser/utils/node_to_text.dart';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import 'model.dart';
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
/// Represents a single location accessible to analysis services.
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
import 'package:sqlparser/utils/node_to_text.dart';
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:moor/moor.dart' show $mrjf, $mrjc, UpdateKind;
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/model/base_entity.dart';
|
||||
import 'package:moor_generator/src/utils/hash.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/model/base_entity.dart';
|
||||
import 'package:drift_dev/src/utils/hash.dart';
|
||||
import 'package:drift_dev/src/writer/writer.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:moor/moor.dart' show UpdateKind;
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/model/used_type_converter.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/model/used_type_converter.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import 'model.dart';
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:moor_generator/src/model/model.dart';
|
||||
import 'package:moor_generator/src/utils/type_utils.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:drift_dev/src/model/model.dart';
|
||||
import 'package:drift_dev/src/utils/type_utils.dart';
|
||||
import 'package:drift_dev/writer.dart';
|
||||
|
||||
/// Something that has a type.
|
||||
///
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/nullability_suffix.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:moor_generator/src/model/table.dart';
|
||||
import 'package:moor_generator/src/utils/type_utils.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:drift_dev/src/model/table.dart';
|
||||
import 'package:drift_dev/src/utils/type_utils.dart';
|
||||
import 'package:drift_dev/src/writer/writer.dart';
|
||||
|
||||
import 'column.dart';
|
||||
import 'types.dart';
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:moor_generator/src/utils/names.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/utils/names.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:moor/moor.dart';
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
class FindStreamUpdateRules {
|
|
@ -2,7 +2,7 @@
|
|||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_generated.dart';
|
||||
import 'package:analyzer_plugin/utilities/assist/assist.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import '../utils.dart';
|
|
@ -1,6 +1,6 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
import 'utils.dart';
|
|
@ -1,8 +1,8 @@
|
|||
//@dart=2.9
|
||||
import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
||||
import 'package:analyzer_plugin/protocol/protocol_generated.dart';
|
||||
import 'package:moor_generator/src/analyzer/session.dart';
|
||||
import 'package:moor_generator/src/services/ide/assists/assist_service.dart';
|
||||
import 'package:drift_dev/src/analyzer/session.dart';
|
||||
import 'package:drift_dev/src/services/ide/assists/assist_service.dart';
|
||||
|
||||
import 'package:path/path.dart';
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
//@dart=2.9
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/results.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:drift_dev/src/analyzer/runner/results.dart';
|
||||
|
||||
extension CurrentResults on FoundFile {
|
||||
ParsedMoorFile get parsedMoorOrNull {
|
|
@ -1,4 +1,4 @@
|
|||
import 'package:moor_generator/src/analyzer/moor/moor_ffi_extension.dart';
|
||||
import 'package:drift_dev/src/analyzer/moor/moor_ffi_extension.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
// ignore: implementation_imports
|
||||
import 'package:sqlparser/src/utils/ast_equality.dart';
|
|
@ -1,6 +1,6 @@
|
|||
//@dart=2.9
|
||||
import 'package:moor_generator/moor_generator.dart';
|
||||
import 'package:moor_generator/src/analyzer/options.dart';
|
||||
import 'package:drift_dev/moor_generator.dart';
|
||||
import 'package:drift_dev/src/analyzer/options.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue