mirror of https://github.com/AMT-Cheif/drift.git
Generator: Extract writer into a top-level library
This commit is contained in:
parent
99cf31bb61
commit
bdea374fa2
|
@ -6,7 +6,6 @@ analyzer:
|
|||
unused_import: error
|
||||
unused_local_variable: error
|
||||
dead_code: error
|
||||
override_on_non_overriding_method: error
|
||||
public_member_api_docs: ignore # turned on by user-facing subpackages
|
||||
exclude:
|
||||
- "**/*.g.dart"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:build/build.dart';
|
||||
import 'package:moor_generator/src/backends/build/moor_builder.dart';
|
||||
import 'package:moor_generator/src/writer/queries/query_writer.dart';
|
||||
import 'package:moor_generator/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/src/writer/database_writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
const _ignoredLints = [
|
||||
|
|
|
@ -5,7 +5,7 @@ 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/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:source_gen/source_gen.dart';
|
||||
|
||||
class MoorBuilder extends SharedPartBuilder {
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import 'package:moor_generator/src/model/specified_db_classes.dart';
|
||||
import 'package:moor_generator/src/writer/queries/query_writer.dart';
|
||||
import 'package:moor_generator/src/writer/tables/table_writer.dart';
|
||||
import 'package:moor_generator/src/writer/utils/memoized_getter.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
|
||||
/// Generates the Dart code put into a `.g.dart` file when running the
|
||||
|
|
|
@ -4,8 +4,7 @@ import 'package:moor_generator/src/analyzer/options.dart';
|
|||
import 'package:moor_generator/src/model/specified_column.dart';
|
||||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/utils/string_escaper.dart';
|
||||
import 'package:moor_generator/src/writer/queries/result_set_writer.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
import 'package:sqlparser/sqlparser.dart' hide ResultColumn;
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:moor_generator/src/model/sql_query.dart';
|
||||
import 'package:moor_generator/src/writer/utils/hash_code.dart';
|
||||
import 'package:moor_generator/src/writer/utils/override_equals.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
|
||||
/// Writes a class holding the result of an sql query into Dart.
|
||||
class ResultSetWriter {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:moor_generator/src/model/specified_table.dart';
|
||||
import 'package:moor_generator/src/writer/utils/hash_code.dart';
|
||||
import 'package:moor_generator/src/writer/utils/override_equals.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:recase/recase.dart';
|
||||
|
||||
class DataClassWriter {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
import 'package:moor_generator/src/model/specified_column.dart';
|
||||
import 'package:moor_generator/src/model/specified_table.dart';
|
||||
import 'package:moor_generator/src/utils/string_escaper.dart';
|
||||
import 'package:moor_generator/src/writer/tables/data_class_writer.dart';
|
||||
import 'package:moor_generator/src/writer/tables/update_companion_writer.dart';
|
||||
import 'package:moor_generator/src/writer/utils/memoized_getter.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
import 'package:sqlparser/sqlparser.dart';
|
||||
|
||||
class TableWriter {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:moor_generator/src/model/specified_column.dart';
|
||||
import 'package:moor_generator/src/model/specified_table.dart';
|
||||
import 'package:moor_generator/src/writer/writer.dart';
|
||||
import 'package:moor_generator/writer.dart';
|
||||
|
||||
class UpdateCompanionWriter {
|
||||
final SpecifiedTable table;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/// Provides access to the [Writer], which can generate Dart code for parsed
|
||||
/// databases, daos, queries, tables and more.
|
||||
library writer;
|
||||
|
||||
import 'src/writer/writer.dart' show Writer;
|
||||
|
||||
export 'src/writer/database_writer.dart';
|
||||
export 'src/writer/queries/query_writer.dart';
|
||||
export 'src/writer/queries/result_set_writer.dart';
|
||||
export 'src/writer/tables/data_class_writer.dart';
|
||||
export 'src/writer/tables/table_writer.dart';
|
||||
export 'src/writer/tables/update_companion_writer.dart';
|
||||
export 'src/writer/utils/hash_code.dart';
|
||||
export 'src/writer/utils/memoized_getter.dart';
|
||||
export 'src/writer/utils/override_equals.dart';
|
||||
export 'src/writer/writer.dart';
|
Loading…
Reference in New Issue