From 24d3125bef6ca8fa9f440203f39d7c0055810dbe Mon Sep 17 00:00:00 2001 From: Tyler-Larkin Date: Sun, 1 Dec 2024 17:53:23 -0800 Subject: [PATCH] chore(db,storage): regenerated Drift databases and tables --- .../example/bin/database.g.dart | 284 ++++++++++++++ .../example/web/database.g.dart | 284 ++++++++++++++ .../test/database.g.dart | 299 ++++++++------ .../transfer/database/database_io.drift.dart | 1 + .../transfer/database/tables.drift.dart | 291 ++++++++------ .../test/pub_server/lib/src/database.g.dart | 368 +++++++++++------- 6 files changed, 1143 insertions(+), 384 deletions(-) diff --git a/packages/common/amplify_db_common_dart/example/bin/database.g.dart b/packages/common/amplify_db_common_dart/example/bin/database.g.dart index 3f9bc53dbb..42fcfa9428 100644 --- a/packages/common/amplify_db_common_dart/example/bin/database.g.dart +++ b/packages/common/amplify_db_common_dart/example/bin/database.g.dart @@ -159,6 +159,15 @@ class Todo extends DataClass implements Insertable { content: content ?? this.content, category: category.present ? category.value : this.category, ); + Todo copyWithCompanion(TodosCompanion data) { + return Todo( + id: data.id.present ? data.id.value : this.id, + title: data.title.present ? data.title.value : this.title, + content: data.content.present ? data.content.value : this.content, + category: data.category.present ? data.category.value : this.category, + ); + } + @override String toString() { return (StringBuffer('Todo(') @@ -363,6 +372,14 @@ class Category extends DataClass implements Insertable { id: id ?? this.id, description: description ?? this.description, ); + Category copyWithCompanion(CategoriesCompanion data) { + return Category( + id: data.id.present ? data.id.value : this.id, + description: + data.description.present ? data.description.value : this.description, + ); + } + @override String toString() { return (StringBuffer('Category(') @@ -434,6 +451,7 @@ class CategoriesCompanion extends UpdateCompanion { abstract class _$MyDatabase extends GeneratedDatabase { _$MyDatabase(QueryExecutor e) : super(e); + $MyDatabaseManager get managers => $MyDatabaseManager(this); late final $TodosTable todos = $TodosTable(this); late final $CategoriesTable categories = $CategoriesTable(this); @override @@ -442,3 +460,269 @@ abstract class _$MyDatabase extends GeneratedDatabase { @override List get allSchemaEntities => [todos, categories]; } + +typedef $$TodosTableCreateCompanionBuilder = TodosCompanion Function({ + Value id, + required String title, + required String content, + Value category, +}); +typedef $$TodosTableUpdateCompanionBuilder = TodosCompanion Function({ + Value id, + Value title, + Value content, + Value category, +}); + +class $$TodosTableFilterComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnFilters(column)); + + ColumnFilters get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnFilters(column)); + + ColumnFilters get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnFilters(column)); +} + +class $$TodosTableOrderingComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnOrderings(column)); +} + +class $$TodosTableAnnotationComposer + extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + GeneratedColumn get content => + $composableBuilder(column: $table.content, builder: (column) => column); + + GeneratedColumn get category => + $composableBuilder(column: $table.category, builder: (column) => column); +} + +class $$TodosTableTableManager extends RootTableManager< + _$MyDatabase, + $TodosTable, + Todo, + $$TodosTableFilterComposer, + $$TodosTableOrderingComposer, + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()> { + $$TodosTableTableManager(_$MyDatabase db, $TodosTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$TodosTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$TodosTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$TodosTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value title = const Value.absent(), + Value content = const Value.absent(), + Value category = const Value.absent(), + }) => + TodosCompanion( + id: id, + title: title, + content: content, + category: category, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String title, + required String content, + Value category = const Value.absent(), + }) => + TodosCompanion.insert( + id: id, + title: title, + content: content, + category: category, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$TodosTableProcessedTableManager = ProcessedTableManager< + _$MyDatabase, + $TodosTable, + Todo, + $$TodosTableFilterComposer, + $$TodosTableOrderingComposer, + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()>; +typedef $$CategoriesTableCreateCompanionBuilder = CategoriesCompanion Function({ + Value id, + required String description, +}); +typedef $$CategoriesTableUpdateCompanionBuilder = CategoriesCompanion Function({ + Value id, + Value description, +}); + +class $$CategoriesTableFilterComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnFilters(column)); +} + +class $$CategoriesTableOrderingComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnOrderings(column)); +} + +class $$CategoriesTableAnnotationComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get description => $composableBuilder( + column: $table.description, builder: (column) => column); +} + +class $$CategoriesTableTableManager extends RootTableManager< + _$MyDatabase, + $CategoriesTable, + Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()> { + $$CategoriesTableTableManager(_$MyDatabase db, $CategoriesTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$CategoriesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$CategoriesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$CategoriesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value description = const Value.absent(), + }) => + CategoriesCompanion( + id: id, + description: description, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String description, + }) => + CategoriesCompanion.insert( + id: id, + description: description, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$CategoriesTableProcessedTableManager = ProcessedTableManager< + _$MyDatabase, + $CategoriesTable, + Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()>; + +class $MyDatabaseManager { + final _$MyDatabase _db; + $MyDatabaseManager(this._db); + $$TodosTableTableManager get todos => + $$TodosTableTableManager(_db, _db.todos); + $$CategoriesTableTableManager get categories => + $$CategoriesTableTableManager(_db, _db.categories); +} diff --git a/packages/common/amplify_db_common_dart/example/web/database.g.dart b/packages/common/amplify_db_common_dart/example/web/database.g.dart index 3f9bc53dbb..42fcfa9428 100644 --- a/packages/common/amplify_db_common_dart/example/web/database.g.dart +++ b/packages/common/amplify_db_common_dart/example/web/database.g.dart @@ -159,6 +159,15 @@ class Todo extends DataClass implements Insertable { content: content ?? this.content, category: category.present ? category.value : this.category, ); + Todo copyWithCompanion(TodosCompanion data) { + return Todo( + id: data.id.present ? data.id.value : this.id, + title: data.title.present ? data.title.value : this.title, + content: data.content.present ? data.content.value : this.content, + category: data.category.present ? data.category.value : this.category, + ); + } + @override String toString() { return (StringBuffer('Todo(') @@ -363,6 +372,14 @@ class Category extends DataClass implements Insertable { id: id ?? this.id, description: description ?? this.description, ); + Category copyWithCompanion(CategoriesCompanion data) { + return Category( + id: data.id.present ? data.id.value : this.id, + description: + data.description.present ? data.description.value : this.description, + ); + } + @override String toString() { return (StringBuffer('Category(') @@ -434,6 +451,7 @@ class CategoriesCompanion extends UpdateCompanion { abstract class _$MyDatabase extends GeneratedDatabase { _$MyDatabase(QueryExecutor e) : super(e); + $MyDatabaseManager get managers => $MyDatabaseManager(this); late final $TodosTable todos = $TodosTable(this); late final $CategoriesTable categories = $CategoriesTable(this); @override @@ -442,3 +460,269 @@ abstract class _$MyDatabase extends GeneratedDatabase { @override List get allSchemaEntities => [todos, categories]; } + +typedef $$TodosTableCreateCompanionBuilder = TodosCompanion Function({ + Value id, + required String title, + required String content, + Value category, +}); +typedef $$TodosTableUpdateCompanionBuilder = TodosCompanion Function({ + Value id, + Value title, + Value content, + Value category, +}); + +class $$TodosTableFilterComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnFilters(column)); + + ColumnFilters get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnFilters(column)); + + ColumnFilters get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnFilters(column)); +} + +class $$TodosTableOrderingComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnOrderings(column)); +} + +class $$TodosTableAnnotationComposer + extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + GeneratedColumn get content => + $composableBuilder(column: $table.content, builder: (column) => column); + + GeneratedColumn get category => + $composableBuilder(column: $table.category, builder: (column) => column); +} + +class $$TodosTableTableManager extends RootTableManager< + _$MyDatabase, + $TodosTable, + Todo, + $$TodosTableFilterComposer, + $$TodosTableOrderingComposer, + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()> { + $$TodosTableTableManager(_$MyDatabase db, $TodosTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$TodosTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$TodosTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$TodosTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value title = const Value.absent(), + Value content = const Value.absent(), + Value category = const Value.absent(), + }) => + TodosCompanion( + id: id, + title: title, + content: content, + category: category, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String title, + required String content, + Value category = const Value.absent(), + }) => + TodosCompanion.insert( + id: id, + title: title, + content: content, + category: category, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$TodosTableProcessedTableManager = ProcessedTableManager< + _$MyDatabase, + $TodosTable, + Todo, + $$TodosTableFilterComposer, + $$TodosTableOrderingComposer, + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()>; +typedef $$CategoriesTableCreateCompanionBuilder = CategoriesCompanion Function({ + Value id, + required String description, +}); +typedef $$CategoriesTableUpdateCompanionBuilder = CategoriesCompanion Function({ + Value id, + Value description, +}); + +class $$CategoriesTableFilterComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnFilters(column)); +} + +class $$CategoriesTableOrderingComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnOrderings(column)); +} + +class $$CategoriesTableAnnotationComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get description => $composableBuilder( + column: $table.description, builder: (column) => column); +} + +class $$CategoriesTableTableManager extends RootTableManager< + _$MyDatabase, + $CategoriesTable, + Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()> { + $$CategoriesTableTableManager(_$MyDatabase db, $CategoriesTable table) + : super(TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + $$CategoriesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$CategoriesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$CategoriesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + Value id = const Value.absent(), + Value description = const Value.absent(), + }) => + CategoriesCompanion( + id: id, + description: description, + ), + createCompanionCallback: ({ + Value id = const Value.absent(), + required String description, + }) => + CategoriesCompanion.insert( + id: id, + description: description, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$CategoriesTableProcessedTableManager = ProcessedTableManager< + _$MyDatabase, + $CategoriesTable, + Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()>; + +class $MyDatabaseManager { + final _$MyDatabase _db; + $MyDatabaseManager(this._db); + $$TodosTableTableManager get todos => + $$TodosTableTableManager(_db, _db.todos); + $$CategoriesTableTableManager get categories => + $$CategoriesTableTableManager(_db, _db.categories); +} diff --git a/packages/common/amplify_db_common_dart/test/database.g.dart b/packages/common/amplify_db_common_dart/test/database.g.dart index 92b53f4d0b..42fcfa9428 100644 --- a/packages/common/amplify_db_common_dart/test/database.g.dart +++ b/packages/common/amplify_db_common_dart/test/database.g.dart @@ -159,6 +159,15 @@ class Todo extends DataClass implements Insertable { content: content ?? this.content, category: category.present ? category.value : this.category, ); + Todo copyWithCompanion(TodosCompanion data) { + return Todo( + id: data.id.present ? data.id.value : this.id, + title: data.title.present ? data.title.value : this.title, + content: data.content.present ? data.content.value : this.content, + category: data.category.present ? data.category.value : this.category, + ); + } + @override String toString() { return (StringBuffer('Todo(') @@ -363,6 +372,14 @@ class Category extends DataClass implements Insertable { id: id ?? this.id, description: description ?? this.description, ); + Category copyWithCompanion(CategoriesCompanion data) { + return Category( + id: data.id.present ? data.id.value : this.id, + description: + data.description.present ? data.description.value : this.description, + ); + } + @override String toString() { return (StringBuffer('Category(') @@ -434,7 +451,7 @@ class CategoriesCompanion extends UpdateCompanion { abstract class _$MyDatabase extends GeneratedDatabase { _$MyDatabase(QueryExecutor e) : super(e); - _$MyDatabaseManager get managers => _$MyDatabaseManager(this); + $MyDatabaseManager get managers => $MyDatabaseManager(this); late final $TodosTable todos = $TodosTable(this); late final $CategoriesTable categories = $CategoriesTable(this); @override @@ -444,7 +461,7 @@ abstract class _$MyDatabase extends GeneratedDatabase { List get allSchemaEntities => [todos, categories]; } -typedef $$TodosTableInsertCompanionBuilder = TodosCompanion Function({ +typedef $$TodosTableCreateCompanionBuilder = TodosCompanion Function({ Value id, required String title, required String content, @@ -457,25 +474,93 @@ typedef $$TodosTableUpdateCompanionBuilder = TodosCompanion Function({ Value category, }); +class $$TodosTableFilterComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnFilters(column)); + + ColumnFilters get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnFilters(column)); + + ColumnFilters get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnFilters(column)); +} + +class $$TodosTableOrderingComposer extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get title => $composableBuilder( + column: $table.title, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get content => $composableBuilder( + column: $table.content, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get category => $composableBuilder( + column: $table.category, builder: (column) => ColumnOrderings(column)); +} + +class $$TodosTableAnnotationComposer + extends Composer<_$MyDatabase, $TodosTable> { + $$TodosTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get title => + $composableBuilder(column: $table.title, builder: (column) => column); + + GeneratedColumn get content => + $composableBuilder(column: $table.content, builder: (column) => column); + + GeneratedColumn get category => + $composableBuilder(column: $table.category, builder: (column) => column); +} + class $$TodosTableTableManager extends RootTableManager< _$MyDatabase, $TodosTable, Todo, $$TodosTableFilterComposer, $$TodosTableOrderingComposer, - $$TodosTableProcessedTableManager, - $$TodosTableInsertCompanionBuilder, - $$TodosTableUpdateCompanionBuilder> { + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()> { $$TodosTableTableManager(_$MyDatabase db, $TodosTable table) : super(TableManagerState( db: db, table: table, - filteringComposer: - $$TodosTableFilterComposer(ComposerState(db, table)), - orderingComposer: - $$TodosTableOrderingComposer(ComposerState(db, table)), - getChildManagerBuilder: (p) => $$TodosTableProcessedTableManager(p), - getUpdateCompanionBuilder: ({ + createFilteringComposer: () => + $$TodosTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$TodosTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$TodosTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ Value id = const Value.absent(), Value title = const Value.absent(), Value content = const Value.absent(), @@ -487,7 +572,7 @@ class $$TodosTableTableManager extends RootTableManager< content: content, category: category, ), - getInsertCompanionBuilder: ({ + createCompanionCallback: ({ Value id = const Value.absent(), required String title, required String content, @@ -499,70 +584,26 @@ class $$TodosTableTableManager extends RootTableManager< content: content, category: category, ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, )); } -class $$TodosTableProcessedTableManager extends ProcessedTableManager< +typedef $$TodosTableProcessedTableManager = ProcessedTableManager< _$MyDatabase, $TodosTable, Todo, $$TodosTableFilterComposer, $$TodosTableOrderingComposer, - $$TodosTableProcessedTableManager, - $$TodosTableInsertCompanionBuilder, - $$TodosTableUpdateCompanionBuilder> { - $$TodosTableProcessedTableManager(super.$state); -} - -class $$TodosTableFilterComposer - extends FilterComposer<_$MyDatabase, $TodosTable> { - $$TodosTableFilterComposer(super.$state); - ColumnFilters get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get title => $state.composableBuilder( - column: $state.table.title, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get content => $state.composableBuilder( - column: $state.table.content, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get category => $state.composableBuilder( - column: $state.table.category, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); -} - -class $$TodosTableOrderingComposer - extends OrderingComposer<_$MyDatabase, $TodosTable> { - $$TodosTableOrderingComposer(super.$state); - ColumnOrderings get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get title => $state.composableBuilder( - column: $state.table.title, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get content => $state.composableBuilder( - column: $state.table.content, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get category => $state.composableBuilder( - column: $state.table.category, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); -} - -typedef $$CategoriesTableInsertCompanionBuilder = CategoriesCompanion Function({ + $$TodosTableAnnotationComposer, + $$TodosTableCreateCompanionBuilder, + $$TodosTableUpdateCompanionBuilder, + (Todo, BaseReferences<_$MyDatabase, $TodosTable, Todo>), + Todo, + PrefetchHooks Function()>; +typedef $$CategoriesTableCreateCompanionBuilder = CategoriesCompanion Function({ Value id, required String description, }); @@ -571,26 +612,77 @@ typedef $$CategoriesTableUpdateCompanionBuilder = CategoriesCompanion Function({ Value description, }); +class $$CategoriesTableFilterComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnFilters(column)); + + ColumnFilters get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnFilters(column)); +} + +class $$CategoriesTableOrderingComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get description => $composableBuilder( + column: $table.description, builder: (column) => ColumnOrderings(column)); +} + +class $$CategoriesTableAnnotationComposer + extends Composer<_$MyDatabase, $CategoriesTable> { + $$CategoriesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + GeneratedColumn get description => $composableBuilder( + column: $table.description, builder: (column) => column); +} + class $$CategoriesTableTableManager extends RootTableManager< _$MyDatabase, $CategoriesTable, Category, $$CategoriesTableFilterComposer, $$CategoriesTableOrderingComposer, - $$CategoriesTableProcessedTableManager, - $$CategoriesTableInsertCompanionBuilder, - $$CategoriesTableUpdateCompanionBuilder> { + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()> { $$CategoriesTableTableManager(_$MyDatabase db, $CategoriesTable table) : super(TableManagerState( db: db, table: table, - filteringComposer: - $$CategoriesTableFilterComposer(ComposerState(db, table)), - orderingComposer: - $$CategoriesTableOrderingComposer(ComposerState(db, table)), - getChildManagerBuilder: (p) => - $$CategoriesTableProcessedTableManager(p), - getUpdateCompanionBuilder: ({ + createFilteringComposer: () => + $$CategoriesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$CategoriesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$CategoriesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ Value id = const Value.absent(), Value description = const Value.absent(), }) => @@ -598,7 +690,7 @@ class $$CategoriesTableTableManager extends RootTableManager< id: id, description: description, ), - getInsertCompanionBuilder: ({ + createCompanionCallback: ({ Value id = const Value.absent(), required String description, }) => @@ -606,52 +698,29 @@ class $$CategoriesTableTableManager extends RootTableManager< id: id, description: description, ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, )); } -class $$CategoriesTableProcessedTableManager extends ProcessedTableManager< +typedef $$CategoriesTableProcessedTableManager = ProcessedTableManager< _$MyDatabase, $CategoriesTable, Category, $$CategoriesTableFilterComposer, $$CategoriesTableOrderingComposer, - $$CategoriesTableProcessedTableManager, - $$CategoriesTableInsertCompanionBuilder, - $$CategoriesTableUpdateCompanionBuilder> { - $$CategoriesTableProcessedTableManager(super.$state); -} - -class $$CategoriesTableFilterComposer - extends FilterComposer<_$MyDatabase, $CategoriesTable> { - $$CategoriesTableFilterComposer(super.$state); - ColumnFilters get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get description => $state.composableBuilder( - column: $state.table.description, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); -} - -class $$CategoriesTableOrderingComposer - extends OrderingComposer<_$MyDatabase, $CategoriesTable> { - $$CategoriesTableOrderingComposer(super.$state); - ColumnOrderings get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get description => $state.composableBuilder( - column: $state.table.description, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); -} + $$CategoriesTableAnnotationComposer, + $$CategoriesTableCreateCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder, + (Category, BaseReferences<_$MyDatabase, $CategoriesTable, Category>), + Category, + PrefetchHooks Function()>; -class _$MyDatabaseManager { +class $MyDatabaseManager { final _$MyDatabase _db; - _$MyDatabaseManager(this._db); + $MyDatabaseManager(this._db); $$TodosTableTableManager get todos => $$TodosTableTableManager(_db, _db.todos); $$CategoriesTableTableManager get categories => diff --git a/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/database_io.drift.dart b/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/database_io.drift.dart index 9c87dfc276..071cd83deb 100644 --- a/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/database_io.drift.dart +++ b/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/database_io.drift.dart @@ -1,3 +1,4 @@ +// dart format width=80 // ignore_for_file: type=lint import 'package:drift/drift.dart' as i0; import 'package:amplify_storage_s3_dart/src/storage_s3_service/transfer/database/tables.drift.dart' diff --git a/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/tables.drift.dart b/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/tables.drift.dart index 30ebd91612..7d9037e154 100644 --- a/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/tables.drift.dart +++ b/packages/storage/amplify_storage_s3_dart/lib/src/storage_s3_service/transfer/database/tables.drift.dart @@ -1,3 +1,4 @@ +// dart format width=80 // ignore_for_file: type=lint import 'package:drift/drift.dart' as i0; import 'package:amplify_storage_s3_dart/src/storage_s3_service/transfer/database/tables.drift.dart' @@ -5,6 +6,164 @@ import 'package:amplify_storage_s3_dart/src/storage_s3_service/transfer/database import 'package:amplify_storage_s3_dart/src/storage_s3_service/transfer/database/tables.dart' as i2; +typedef $$TransferRecordsTableCreateCompanionBuilder + = i1.TransferRecordsCompanion Function({ + i0.Value id, + required String uploadId, + required String objectKey, + required String createdAt, +}); +typedef $$TransferRecordsTableUpdateCompanionBuilder + = i1.TransferRecordsCompanion Function({ + i0.Value id, + i0.Value uploadId, + i0.Value objectKey, + i0.Value createdAt, +}); + +class $$TransferRecordsTableFilterComposer + extends i0.Composer { + $$TransferRecordsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnFilters get id => $composableBuilder( + column: $table.id, builder: (column) => i0.ColumnFilters(column)); + + i0.ColumnFilters get uploadId => $composableBuilder( + column: $table.uploadId, builder: (column) => i0.ColumnFilters(column)); + + i0.ColumnFilters get objectKey => $composableBuilder( + column: $table.objectKey, builder: (column) => i0.ColumnFilters(column)); + + i0.ColumnFilters get createdAt => $composableBuilder( + column: $table.createdAt, builder: (column) => i0.ColumnFilters(column)); +} + +class $$TransferRecordsTableOrderingComposer + extends i0.Composer { + $$TransferRecordsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.ColumnOrderings get id => $composableBuilder( + column: $table.id, builder: (column) => i0.ColumnOrderings(column)); + + i0.ColumnOrderings get uploadId => $composableBuilder( + column: $table.uploadId, builder: (column) => i0.ColumnOrderings(column)); + + i0.ColumnOrderings get objectKey => $composableBuilder( + column: $table.objectKey, + builder: (column) => i0.ColumnOrderings(column)); + + i0.ColumnOrderings get createdAt => $composableBuilder( + column: $table.createdAt, + builder: (column) => i0.ColumnOrderings(column)); +} + +class $$TransferRecordsTableAnnotationComposer + extends i0.Composer { + $$TransferRecordsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + i0.GeneratedColumn get id => + $composableBuilder(column: $table.id, builder: (column) => column); + + i0.GeneratedColumn get uploadId => + $composableBuilder(column: $table.uploadId, builder: (column) => column); + + i0.GeneratedColumn get objectKey => + $composableBuilder(column: $table.objectKey, builder: (column) => column); + + i0.GeneratedColumn get createdAt => + $composableBuilder(column: $table.createdAt, builder: (column) => column); +} + +class $$TransferRecordsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$TransferRecordsTable, + i1.TransferRecord, + i1.$$TransferRecordsTableFilterComposer, + i1.$$TransferRecordsTableOrderingComposer, + i1.$$TransferRecordsTableAnnotationComposer, + $$TransferRecordsTableCreateCompanionBuilder, + $$TransferRecordsTableUpdateCompanionBuilder, + ( + i1.TransferRecord, + i0.BaseReferences + ), + i1.TransferRecord, + i0.PrefetchHooks Function()> { + $$TransferRecordsTableTableManager( + i0.GeneratedDatabase db, i1.$TransferRecordsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + createFilteringComposer: () => + i1.$$TransferRecordsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + i1.$$TransferRecordsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => i1 + .$$TransferRecordsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ + i0.Value id = const i0.Value.absent(), + i0.Value uploadId = const i0.Value.absent(), + i0.Value objectKey = const i0.Value.absent(), + i0.Value createdAt = const i0.Value.absent(), + }) => + i1.TransferRecordsCompanion( + id: id, + uploadId: uploadId, + objectKey: objectKey, + createdAt: createdAt, + ), + createCompanionCallback: ({ + i0.Value id = const i0.Value.absent(), + required String uploadId, + required String objectKey, + required String createdAt, + }) => + i1.TransferRecordsCompanion.insert( + id: id, + uploadId: uploadId, + objectKey: objectKey, + createdAt: createdAt, + ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), i0.BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, + )); +} + +typedef $$TransferRecordsTableProcessedTableManager = i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$TransferRecordsTable, + i1.TransferRecord, + i1.$$TransferRecordsTableFilterComposer, + i1.$$TransferRecordsTableOrderingComposer, + i1.$$TransferRecordsTableAnnotationComposer, + $$TransferRecordsTableCreateCompanionBuilder, + $$TransferRecordsTableUpdateCompanionBuilder, + ( + i1.TransferRecord, + i0.BaseReferences + ), + i1.TransferRecord, + i0.PrefetchHooks Function()>; + class $TransferRecordsTable extends i2.TransferRecords with i0.TableInfo<$TransferRecordsTable, i1.TransferRecord> { @override @@ -164,6 +323,15 @@ class TransferRecord extends i0.DataClass objectKey: objectKey ?? this.objectKey, createdAt: createdAt ?? this.createdAt, ); + TransferRecord copyWithCompanion(i1.TransferRecordsCompanion data) { + return TransferRecord( + id: data.id.present ? data.id.value : this.id, + uploadId: data.uploadId.present ? data.uploadId.value : this.uploadId, + objectKey: data.objectKey.present ? data.objectKey.value : this.objectKey, + createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, + ); + } + @override String toString() { return (StringBuffer('TransferRecord(') @@ -262,126 +430,3 @@ class TransferRecordsCompanion extends i0.UpdateCompanion { .toString(); } } - -typedef $$TransferRecordsTableInsertCompanionBuilder - = i1.TransferRecordsCompanion Function({ - i0.Value id, - required String uploadId, - required String objectKey, - required String createdAt, -}); -typedef $$TransferRecordsTableUpdateCompanionBuilder - = i1.TransferRecordsCompanion Function({ - i0.Value id, - i0.Value uploadId, - i0.Value objectKey, - i0.Value createdAt, -}); - -class $$TransferRecordsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$TransferRecordsTable, - i1.TransferRecord, - i1.$$TransferRecordsTableFilterComposer, - i1.$$TransferRecordsTableOrderingComposer, - $$TransferRecordsTableProcessedTableManager, - $$TransferRecordsTableInsertCompanionBuilder, - $$TransferRecordsTableUpdateCompanionBuilder> { - $$TransferRecordsTableTableManager( - i0.GeneratedDatabase db, i1.$TransferRecordsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: i1.$$TransferRecordsTableFilterComposer( - i0.ComposerState(db, table)), - orderingComposer: i1.$$TransferRecordsTableOrderingComposer( - i0.ComposerState(db, table)), - getChildManagerBuilder: (p) => - $$TransferRecordsTableProcessedTableManager(p), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value uploadId = const i0.Value.absent(), - i0.Value objectKey = const i0.Value.absent(), - i0.Value createdAt = const i0.Value.absent(), - }) => - i1.TransferRecordsCompanion( - id: id, - uploadId: uploadId, - objectKey: objectKey, - createdAt: createdAt, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required String uploadId, - required String objectKey, - required String createdAt, - }) => - i1.TransferRecordsCompanion.insert( - id: id, - uploadId: uploadId, - objectKey: objectKey, - createdAt: createdAt, - ), - )); -} - -class $$TransferRecordsTableProcessedTableManager - extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$TransferRecordsTable, - i1.TransferRecord, - i1.$$TransferRecordsTableFilterComposer, - i1.$$TransferRecordsTableOrderingComposer, - $$TransferRecordsTableProcessedTableManager, - $$TransferRecordsTableInsertCompanionBuilder, - $$TransferRecordsTableUpdateCompanionBuilder> { - $$TransferRecordsTableProcessedTableManager(super.$state); -} - -class $$TransferRecordsTableFilterComposer - extends i0.FilterComposer { - $$TransferRecordsTableFilterComposer(super.$state); - i0.ColumnFilters get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - i0.ColumnFilters(column, joinBuilders: joinBuilders)); - - i0.ColumnFilters get uploadId => $state.composableBuilder( - column: $state.table.uploadId, - builder: (column, joinBuilders) => - i0.ColumnFilters(column, joinBuilders: joinBuilders)); - - i0.ColumnFilters get objectKey => $state.composableBuilder( - column: $state.table.objectKey, - builder: (column, joinBuilders) => - i0.ColumnFilters(column, joinBuilders: joinBuilders)); - - i0.ColumnFilters get createdAt => $state.composableBuilder( - column: $state.table.createdAt, - builder: (column, joinBuilders) => - i0.ColumnFilters(column, joinBuilders: joinBuilders)); -} - -class $$TransferRecordsTableOrderingComposer extends i0 - .OrderingComposer { - $$TransferRecordsTableOrderingComposer(super.$state); - i0.ColumnOrderings get id => $state.composableBuilder( - column: $state.table.id, - builder: (column, joinBuilders) => - i0.ColumnOrderings(column, joinBuilders: joinBuilders)); - - i0.ColumnOrderings get uploadId => $state.composableBuilder( - column: $state.table.uploadId, - builder: (column, joinBuilders) => - i0.ColumnOrderings(column, joinBuilders: joinBuilders)); - - i0.ColumnOrderings get objectKey => $state.composableBuilder( - column: $state.table.objectKey, - builder: (column, joinBuilders) => - i0.ColumnOrderings(column, joinBuilders: joinBuilders)); - - i0.ColumnOrderings get createdAt => $state.composableBuilder( - column: $state.table.createdAt, - builder: (column, joinBuilders) => - i0.ColumnOrderings(column, joinBuilders: joinBuilders)); -} diff --git a/packages/test/pub_server/lib/src/database.g.dart b/packages/test/pub_server/lib/src/database.g.dart index 6387001704..09672a7945 100644 --- a/packages/test/pub_server/lib/src/database.g.dart +++ b/packages/test/pub_server/lib/src/database.g.dart @@ -104,6 +104,13 @@ class Package extends DataClass implements Insertable { name: name ?? this.name, latest: latest ?? this.latest, ); + Package copyWithCompanion(PackagesCompanion data) { + return Package( + name: data.name.present ? data.name.value : this.name, + latest: data.latest.present ? data.latest.value : this.latest, + ); + } + @override String toString() { return (StringBuffer('Package(') @@ -406,6 +413,19 @@ class PackageVersion extends DataClass implements Insertable { changelog: changelog ?? this.changelog, published: published ?? this.published, ); + PackageVersion copyWithCompanion(PackageVersionsCompanion data) { + return PackageVersion( + package: data.package.present ? data.package.value : this.package, + version: data.version.present ? data.version.value : this.version, + archiveUrl: + data.archiveUrl.present ? data.archiveUrl.value : this.archiveUrl, + pubspec: data.pubspec.present ? data.pubspec.value : this.pubspec, + readme: data.readme.present ? data.readme.value : this.readme, + changelog: data.changelog.present ? data.changelog.value : this.changelog, + published: data.published.present ? data.published.value : this.published, + ); + } + @override String toString() { return (StringBuffer('PackageVersion(') @@ -562,7 +582,7 @@ class PackageVersionsCompanion extends UpdateCompanion { abstract class _$PubDatabase extends GeneratedDatabase { _$PubDatabase(QueryExecutor e) : super(e); - _$PubDatabaseManager get managers => _$PubDatabaseManager(this); + $PubDatabaseManager get managers => $PubDatabaseManager(this); late final $PackagesTable packages = $PackagesTable(this); late final $PackageVersionsTable packageVersions = $PackageVersionsTable(this); @@ -574,7 +594,7 @@ abstract class _$PubDatabase extends GeneratedDatabase { [packages, packageVersions]; } -typedef $$PackagesTableInsertCompanionBuilder = PackagesCompanion Function({ +typedef $$PackagesTableCreateCompanionBuilder = PackagesCompanion Function({ required String name, required String latest, Value rowid, @@ -585,26 +605,77 @@ typedef $$PackagesTableUpdateCompanionBuilder = PackagesCompanion Function({ Value rowid, }); +class $$PackagesTableFilterComposer + extends Composer<_$PubDatabase, $PackagesTable> { + $$PackagesTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get name => $composableBuilder( + column: $table.name, builder: (column) => ColumnFilters(column)); + + ColumnFilters get latest => $composableBuilder( + column: $table.latest, builder: (column) => ColumnFilters(column)); +} + +class $$PackagesTableOrderingComposer + extends Composer<_$PubDatabase, $PackagesTable> { + $$PackagesTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get name => $composableBuilder( + column: $table.name, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get latest => $composableBuilder( + column: $table.latest, builder: (column) => ColumnOrderings(column)); +} + +class $$PackagesTableAnnotationComposer + extends Composer<_$PubDatabase, $PackagesTable> { + $$PackagesTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get name => + $composableBuilder(column: $table.name, builder: (column) => column); + + GeneratedColumn get latest => + $composableBuilder(column: $table.latest, builder: (column) => column); +} + class $$PackagesTableTableManager extends RootTableManager< _$PubDatabase, $PackagesTable, Package, $$PackagesTableFilterComposer, $$PackagesTableOrderingComposer, - $$PackagesTableProcessedTableManager, - $$PackagesTableInsertCompanionBuilder, - $$PackagesTableUpdateCompanionBuilder> { + $$PackagesTableAnnotationComposer, + $$PackagesTableCreateCompanionBuilder, + $$PackagesTableUpdateCompanionBuilder, + (Package, BaseReferences<_$PubDatabase, $PackagesTable, Package>), + Package, + PrefetchHooks Function()> { $$PackagesTableTableManager(_$PubDatabase db, $PackagesTable table) : super(TableManagerState( db: db, table: table, - filteringComposer: - $$PackagesTableFilterComposer(ComposerState(db, table)), - orderingComposer: - $$PackagesTableOrderingComposer(ComposerState(db, table)), - getChildManagerBuilder: (p) => - $$PackagesTableProcessedTableManager(p), - getUpdateCompanionBuilder: ({ + createFilteringComposer: () => + $$PackagesTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$PackagesTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$PackagesTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ Value name = const Value.absent(), Value latest = const Value.absent(), Value rowid = const Value.absent(), @@ -614,7 +685,7 @@ class $$PackagesTableTableManager extends RootTableManager< latest: latest, rowid: rowid, ), - getInsertCompanionBuilder: ({ + createCompanionCallback: ({ required String name, required String latest, Value rowid = const Value.absent(), @@ -624,50 +695,26 @@ class $$PackagesTableTableManager extends RootTableManager< latest: latest, rowid: rowid, ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, )); } -class $$PackagesTableProcessedTableManager extends ProcessedTableManager< +typedef $$PackagesTableProcessedTableManager = ProcessedTableManager< _$PubDatabase, $PackagesTable, Package, $$PackagesTableFilterComposer, $$PackagesTableOrderingComposer, - $$PackagesTableProcessedTableManager, - $$PackagesTableInsertCompanionBuilder, - $$PackagesTableUpdateCompanionBuilder> { - $$PackagesTableProcessedTableManager(super.$state); -} - -class $$PackagesTableFilterComposer - extends FilterComposer<_$PubDatabase, $PackagesTable> { - $$PackagesTableFilterComposer(super.$state); - ColumnFilters get name => $state.composableBuilder( - column: $state.table.name, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get latest => $state.composableBuilder( - column: $state.table.latest, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); -} - -class $$PackagesTableOrderingComposer - extends OrderingComposer<_$PubDatabase, $PackagesTable> { - $$PackagesTableOrderingComposer(super.$state); - ColumnOrderings get name => $state.composableBuilder( - column: $state.table.name, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get latest => $state.composableBuilder( - column: $state.table.latest, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); -} - -typedef $$PackageVersionsTableInsertCompanionBuilder = PackageVersionsCompanion + $$PackagesTableAnnotationComposer, + $$PackagesTableCreateCompanionBuilder, + $$PackagesTableUpdateCompanionBuilder, + (Package, BaseReferences<_$PubDatabase, $PackagesTable, Package>), + Package, + PrefetchHooks Function()>; +typedef $$PackageVersionsTableCreateCompanionBuilder = PackageVersionsCompanion Function({ required String package, required String version, @@ -690,27 +737,126 @@ typedef $$PackageVersionsTableUpdateCompanionBuilder = PackageVersionsCompanion Value rowid, }); +class $$PackageVersionsTableFilterComposer + extends Composer<_$PubDatabase, $PackageVersionsTable> { + $$PackageVersionsTableFilterComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnFilters get package => $composableBuilder( + column: $table.package, builder: (column) => ColumnFilters(column)); + + ColumnFilters get version => $composableBuilder( + column: $table.version, builder: (column) => ColumnFilters(column)); + + ColumnFilters get archiveUrl => $composableBuilder( + column: $table.archiveUrl, builder: (column) => ColumnFilters(column)); + + ColumnFilters get pubspec => $composableBuilder( + column: $table.pubspec, builder: (column) => ColumnFilters(column)); + + ColumnFilters get readme => $composableBuilder( + column: $table.readme, builder: (column) => ColumnFilters(column)); + + ColumnFilters get changelog => $composableBuilder( + column: $table.changelog, builder: (column) => ColumnFilters(column)); + + ColumnFilters get published => $composableBuilder( + column: $table.published, builder: (column) => ColumnFilters(column)); +} + +class $$PackageVersionsTableOrderingComposer + extends Composer<_$PubDatabase, $PackageVersionsTable> { + $$PackageVersionsTableOrderingComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + ColumnOrderings get package => $composableBuilder( + column: $table.package, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get version => $composableBuilder( + column: $table.version, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get archiveUrl => $composableBuilder( + column: $table.archiveUrl, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get pubspec => $composableBuilder( + column: $table.pubspec, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get readme => $composableBuilder( + column: $table.readme, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get changelog => $composableBuilder( + column: $table.changelog, builder: (column) => ColumnOrderings(column)); + + ColumnOrderings get published => $composableBuilder( + column: $table.published, builder: (column) => ColumnOrderings(column)); +} + +class $$PackageVersionsTableAnnotationComposer + extends Composer<_$PubDatabase, $PackageVersionsTable> { + $$PackageVersionsTableAnnotationComposer({ + required super.$db, + required super.$table, + super.joinBuilder, + super.$addJoinBuilderToRootComposer, + super.$removeJoinBuilderFromRootComposer, + }); + GeneratedColumn get package => + $composableBuilder(column: $table.package, builder: (column) => column); + + GeneratedColumn get version => + $composableBuilder(column: $table.version, builder: (column) => column); + + GeneratedColumn get archiveUrl => $composableBuilder( + column: $table.archiveUrl, builder: (column) => column); + + GeneratedColumn get pubspec => + $composableBuilder(column: $table.pubspec, builder: (column) => column); + + GeneratedColumn get readme => + $composableBuilder(column: $table.readme, builder: (column) => column); + + GeneratedColumn get changelog => + $composableBuilder(column: $table.changelog, builder: (column) => column); + + GeneratedColumn get published => + $composableBuilder(column: $table.published, builder: (column) => column); +} + class $$PackageVersionsTableTableManager extends RootTableManager< _$PubDatabase, $PackageVersionsTable, PackageVersion, $$PackageVersionsTableFilterComposer, $$PackageVersionsTableOrderingComposer, - $$PackageVersionsTableProcessedTableManager, - $$PackageVersionsTableInsertCompanionBuilder, - $$PackageVersionsTableUpdateCompanionBuilder> { + $$PackageVersionsTableAnnotationComposer, + $$PackageVersionsTableCreateCompanionBuilder, + $$PackageVersionsTableUpdateCompanionBuilder, + ( + PackageVersion, + BaseReferences<_$PubDatabase, $PackageVersionsTable, PackageVersion> + ), + PackageVersion, + PrefetchHooks Function()> { $$PackageVersionsTableTableManager( _$PubDatabase db, $PackageVersionsTable table) : super(TableManagerState( db: db, table: table, - filteringComposer: - $$PackageVersionsTableFilterComposer(ComposerState(db, table)), - orderingComposer: - $$PackageVersionsTableOrderingComposer(ComposerState(db, table)), - getChildManagerBuilder: (p) => - $$PackageVersionsTableProcessedTableManager(p), - getUpdateCompanionBuilder: ({ + createFilteringComposer: () => + $$PackageVersionsTableFilterComposer($db: db, $table: table), + createOrderingComposer: () => + $$PackageVersionsTableOrderingComposer($db: db, $table: table), + createComputedFieldComposer: () => + $$PackageVersionsTableAnnotationComposer($db: db, $table: table), + updateCompanionCallback: ({ Value package = const Value.absent(), Value version = const Value.absent(), Value archiveUrl = const Value.absent(), @@ -730,7 +876,7 @@ class $$PackageVersionsTableTableManager extends RootTableManager< published: published, rowid: rowid, ), - getInsertCompanionBuilder: ({ + createCompanionCallback: ({ required String package, required String version, required String archiveUrl, @@ -750,102 +896,32 @@ class $$PackageVersionsTableTableManager extends RootTableManager< published: published, rowid: rowid, ), + withReferenceMapper: (p0) => p0 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) + .toList(), + prefetchHooksCallback: null, )); } -class $$PackageVersionsTableProcessedTableManager extends ProcessedTableManager< +typedef $$PackageVersionsTableProcessedTableManager = ProcessedTableManager< _$PubDatabase, $PackageVersionsTable, PackageVersion, $$PackageVersionsTableFilterComposer, $$PackageVersionsTableOrderingComposer, - $$PackageVersionsTableProcessedTableManager, - $$PackageVersionsTableInsertCompanionBuilder, - $$PackageVersionsTableUpdateCompanionBuilder> { - $$PackageVersionsTableProcessedTableManager(super.$state); -} - -class $$PackageVersionsTableFilterComposer - extends FilterComposer<_$PubDatabase, $PackageVersionsTable> { - $$PackageVersionsTableFilterComposer(super.$state); - ColumnFilters get package => $state.composableBuilder( - column: $state.table.package, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get version => $state.composableBuilder( - column: $state.table.version, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get archiveUrl => $state.composableBuilder( - column: $state.table.archiveUrl, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get pubspec => $state.composableBuilder( - column: $state.table.pubspec, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get readme => $state.composableBuilder( - column: $state.table.readme, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get changelog => $state.composableBuilder( - column: $state.table.changelog, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); - - ColumnFilters get published => $state.composableBuilder( - column: $state.table.published, - builder: (column, joinBuilders) => - ColumnFilters(column, joinBuilders: joinBuilders)); -} - -class $$PackageVersionsTableOrderingComposer - extends OrderingComposer<_$PubDatabase, $PackageVersionsTable> { - $$PackageVersionsTableOrderingComposer(super.$state); - ColumnOrderings get package => $state.composableBuilder( - column: $state.table.package, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get version => $state.composableBuilder( - column: $state.table.version, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get archiveUrl => $state.composableBuilder( - column: $state.table.archiveUrl, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get pubspec => $state.composableBuilder( - column: $state.table.pubspec, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get readme => $state.composableBuilder( - column: $state.table.readme, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get changelog => $state.composableBuilder( - column: $state.table.changelog, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); - - ColumnOrderings get published => $state.composableBuilder( - column: $state.table.published, - builder: (column, joinBuilders) => - ColumnOrderings(column, joinBuilders: joinBuilders)); -} + $$PackageVersionsTableAnnotationComposer, + $$PackageVersionsTableCreateCompanionBuilder, + $$PackageVersionsTableUpdateCompanionBuilder, + ( + PackageVersion, + BaseReferences<_$PubDatabase, $PackageVersionsTable, PackageVersion> + ), + PackageVersion, + PrefetchHooks Function()>; -class _$PubDatabaseManager { +class $PubDatabaseManager { final _$PubDatabase _db; - _$PubDatabaseManager(this._db); + $PubDatabaseManager(this._db); $$PackagesTableTableManager get packages => $$PackagesTableTableManager(_db, _db.packages); $$PackageVersionsTableTableManager get packageVersions =>