diff --git a/docs/lib/snippets/_shared/todo_tables.drift.dart b/docs/lib/snippets/_shared/todo_tables.drift.dart index 8a5e2d92..8141c47e 100644 --- a/docs/lib/snippets/_shared/todo_tables.drift.dart +++ b/docs/lib/snippets/_shared/todo_tables.drift.dart @@ -2,6 +2,7 @@ import 'package:drift/drift.dart' as i0; import 'package:drift_docs/snippets/_shared/todo_tables.drift.dart' as i1; import 'package:drift_docs/snippets/_shared/todo_tables.dart' as i2; +import 'package:drift/internal/modular.dart' as i3; class $TodoItemsTable extends i2.TodoItems with i0.TableInfo<$TodoItemsTable, i1.TodoItem> { @@ -300,6 +301,133 @@ class TodoItemsCompanion extends i0.UpdateCompanion { } } +class $$TodoItemsTableFilterComposer + extends i0.FilterComposer { + $$TodoItemsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get title => i0.ColumnFilters($table.title); + i0.ColumnFilters get content => i0.ColumnFilters($table.content); + i0.ColumnFilters get categoryId => i0.ColumnFilters($table.category); + i0.ComposableFilter category( + i0.ComposableFilter Function(i1.$$CategoriesTableFilterComposer f) f) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i3.ReadDatabaseContainer($db) + .resultSet('categories'), + getCurrentColumn: (f) => f.category, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$$CategoriesTableFilterComposer(db, table), + builder: f); + } + + i0.ColumnFilters get dueDate => i0.ColumnFilters($table.dueDate); +} + +class $$TodoItemsTableOrderingComposer + extends i0.OrderingComposer { + $$TodoItemsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get title => i0.ColumnOrderings($table.title); + i0.ColumnOrderings get content => i0.ColumnOrderings($table.content); + i0.ColumnOrderings get categoryId => i0.ColumnOrderings($table.category); + i0.ComposableOrdering category( + i0.ComposableOrdering Function(i1.$$CategoriesTableOrderingComposer o) + o) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i3.ReadDatabaseContainer($db) + .resultSet('categories'), + getCurrentColumn: (f) => f.category, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$$CategoriesTableOrderingComposer(db, table), + builder: o); + } + + i0.ColumnOrderings get dueDate => + i0.ColumnOrderings($table.dueDate); +} + +class $$TodoItemsTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$TodoItemsTable, + i1.TodoItem, + $$TodoItemsTableFilterComposer, + $$TodoItemsTableOrderingComposer, + $$TodoItemsTableProcessedTableManager, + $$TodoItemsTableInsertCompanionBuilder, + $$TodoItemsTableUpdateCompanionBuilder> { + const $$TodoItemsTableProcessedTableManager(super.$state); +} + +typedef $$TodoItemsTableInsertCompanionBuilder = i1.TodoItemsCompanion + Function({ + i0.Value id, + required String title, + required String content, + i0.Value category, + i0.Value dueDate, +}); +typedef $$TodoItemsTableUpdateCompanionBuilder = i1.TodoItemsCompanion + Function({ + i0.Value id, + i0.Value title, + i0.Value content, + i0.Value category, + i0.Value dueDate, +}); + +class $$TodoItemsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$TodoItemsTable, + i1.TodoItem, + $$TodoItemsTableFilterComposer, + $$TodoItemsTableOrderingComposer, + $$TodoItemsTableProcessedTableManager, + $$TodoItemsTableInsertCompanionBuilder, + $$TodoItemsTableUpdateCompanionBuilder> { + $$TodoItemsTableTableManager( + i0.GeneratedDatabase db, i1.$TodoItemsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$TodoItemsTableFilterComposer(db, table), + orderingComposer: $$TodoItemsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$TodoItemsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value content = const i0.Value.absent(), + i0.Value category = const i0.Value.absent(), + i0.Value dueDate = const i0.Value.absent(), + }) => + i1.TodoItemsCompanion( + id: id, + title: title, + content: content, + category: category, + dueDate: dueDate, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String title, + required String content, + i0.Value category = const i0.Value.absent(), + i0.Value dueDate = const i0.Value.absent(), + }) => + i1.TodoItemsCompanion.insert( + id: id, + title: title, + content: content, + category: category, + dueDate: dueDate, + ))); +} + class $CategoriesTable extends i2.Categories with i0.TableInfo<$CategoriesTable, i1.Category> { @override @@ -471,6 +599,79 @@ class CategoriesCompanion extends i0.UpdateCompanion { } } +class $$CategoriesTableFilterComposer + extends i0.FilterComposer { + $$CategoriesTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get name => i0.ColumnFilters($table.name); +} + +class $$CategoriesTableOrderingComposer + extends i0.OrderingComposer { + $$CategoriesTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get name => i0.ColumnOrderings($table.name); +} + +class $$CategoriesTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$CategoriesTable, + i1.Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableProcessedTableManager, + $$CategoriesTableInsertCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder> { + const $$CategoriesTableProcessedTableManager(super.$state); +} + +typedef $$CategoriesTableInsertCompanionBuilder = i1.CategoriesCompanion + Function({ + i0.Value id, + required String name, +}); +typedef $$CategoriesTableUpdateCompanionBuilder = i1.CategoriesCompanion + Function({ + i0.Value id, + i0.Value name, +}); + +class $$CategoriesTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$CategoriesTable, + i1.Category, + $$CategoriesTableFilterComposer, + $$CategoriesTableOrderingComposer, + $$CategoriesTableProcessedTableManager, + $$CategoriesTableInsertCompanionBuilder, + $$CategoriesTableUpdateCompanionBuilder> { + $$CategoriesTableTableManager( + i0.GeneratedDatabase db, i1.$CategoriesTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$CategoriesTableFilterComposer(db, table), + orderingComposer: $$CategoriesTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$CategoriesTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value name = const i0.Value.absent(), + }) => + i1.CategoriesCompanion( + id: id, + name: name, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String name, + }) => + i1.CategoriesCompanion.insert( + id: id, + name: name, + ))); +} + class $UsersTable extends i2.Users with i0.TableInfo<$UsersTable, i1.User> { @override final i0.GeneratedDatabase attachedDatabase; @@ -643,3 +844,75 @@ class UsersCompanion extends i0.UpdateCompanion { .toString(); } } + +class $$UsersTableFilterComposer + extends i0.FilterComposer { + $$UsersTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get birthDate => + i0.ColumnFilters($table.birthDate); +} + +class $$UsersTableOrderingComposer + extends i0.OrderingComposer { + $$UsersTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get birthDate => + i0.ColumnOrderings($table.birthDate); +} + +class $$UsersTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$UsersTable, + i1.User, + $$UsersTableFilterComposer, + $$UsersTableOrderingComposer, + $$UsersTableProcessedTableManager, + $$UsersTableInsertCompanionBuilder, + $$UsersTableUpdateCompanionBuilder> { + const $$UsersTableProcessedTableManager(super.$state); +} + +typedef $$UsersTableInsertCompanionBuilder = i1.UsersCompanion Function({ + i0.Value id, + required DateTime birthDate, +}); +typedef $$UsersTableUpdateCompanionBuilder = i1.UsersCompanion Function({ + i0.Value id, + i0.Value birthDate, +}); + +class $$UsersTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$UsersTable, + i1.User, + $$UsersTableFilterComposer, + $$UsersTableOrderingComposer, + $$UsersTableProcessedTableManager, + $$UsersTableInsertCompanionBuilder, + $$UsersTableUpdateCompanionBuilder> { + $$UsersTableTableManager(i0.GeneratedDatabase db, i1.$UsersTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$UsersTableFilterComposer(db, table), + orderingComposer: $$UsersTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$UsersTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value birthDate = const i0.Value.absent(), + }) => + i1.UsersCompanion( + id: id, + birthDate: birthDate, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required DateTime birthDate, + }) => + i1.UsersCompanion.insert( + id: id, + birthDate: birthDate, + ))); +} diff --git a/docs/lib/snippets/drift_files/custom_queries.drift.dart b/docs/lib/snippets/drift_files/custom_queries.drift.dart index 651da4ec..c07a58c9 100644 --- a/docs/lib/snippets/drift_files/custom_queries.drift.dart +++ b/docs/lib/snippets/drift_files/custom_queries.drift.dart @@ -1,7 +1,6 @@ // ignore_for_file: type=lint import 'package:drift/drift.dart' as i0; import 'package:drift_docs/snippets/_shared/todo_tables.drift.dart' as i1; -import 'package:drift/internal/modular.dart' as i2; abstract class $MyDatabase extends i0.GeneratedDatabase { $MyDatabase(i0.QueryExecutor e) : super(e); @@ -30,225 +29,13 @@ abstract class $MyDatabase extends i0.GeneratedDatabase { [categories, todoItems]; } -class $$CategoriesTableFilterComposer - extends i0.FilterComposer { - $$CategoriesTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ColumnFilters get name => i0.ColumnFilters($table.name); - i0.ComposableFilter todoItemsRefs( - i0.ComposableFilter Function($$TodoItemsTableFilterComposer f) f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i2.ReadDatabaseContainer($db) - .resultSet('todo_items'), - getCurrentColumn: (f) => f.id, - getReferencedColumn: (f) => f.category, - getReferencedComposer: (db, table) => - $$TodoItemsTableFilterComposer(db, table), - builder: f); - } -} - -class $$CategoriesTableOrderingComposer - extends i0.OrderingComposer { - $$CategoriesTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); - i0.ColumnOrderings get name => i0.ColumnOrderings($table.name); -} - -class $$CategoriesTableProcessedTableManager extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$CategoriesTable, - i1.Category, - $$CategoriesTableFilterComposer, - $$CategoriesTableOrderingComposer, - $$CategoriesTableProcessedTableManager, - $$CategoriesTableInsertCompanionBuilder, - $$CategoriesTableUpdateCompanionBuilder> { - const $$CategoriesTableProcessedTableManager(super.$state); -} - -typedef $$CategoriesTableInsertCompanionBuilder = i1.CategoriesCompanion - Function({ - i0.Value id, - required String name, -}); -typedef $$CategoriesTableUpdateCompanionBuilder = i1.CategoriesCompanion - Function({ - i0.Value id, - i0.Value name, -}); - -class $$CategoriesTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$CategoriesTable, - i1.Category, - $$CategoriesTableFilterComposer, - $$CategoriesTableOrderingComposer, - $$CategoriesTableProcessedTableManager, - $$CategoriesTableInsertCompanionBuilder, - $$CategoriesTableUpdateCompanionBuilder> { - $$CategoriesTableTableManager( - i0.GeneratedDatabase db, i1.$CategoriesTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$CategoriesTableFilterComposer(db, table), - orderingComposer: $$CategoriesTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$CategoriesTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value name = const i0.Value.absent(), - }) => - i1.CategoriesCompanion( - id: id, - name: name, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required String name, - }) => - i1.CategoriesCompanion.insert( - id: id, - name: name, - ))); -} - -class $$TodoItemsTableFilterComposer - extends i0.FilterComposer { - $$TodoItemsTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ColumnFilters get title => i0.ColumnFilters($table.title); - i0.ColumnFilters get content => i0.ColumnFilters($table.content); - i0.ColumnFilters get categoryId => i0.ColumnFilters($table.category); - i0.ComposableFilter category( - i0.ComposableFilter Function($$CategoriesTableFilterComposer f) f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i2.ReadDatabaseContainer($db) - .resultSet('categories'), - getCurrentColumn: (f) => f.category, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$CategoriesTableFilterComposer(db, table), - builder: f); - } - - i0.ColumnFilters get dueDate => i0.ColumnFilters($table.dueDate); -} - -class $$TodoItemsTableOrderingComposer - extends i0.OrderingComposer { - $$TodoItemsTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); - i0.ColumnOrderings get title => i0.ColumnOrderings($table.title); - i0.ColumnOrderings get content => i0.ColumnOrderings($table.content); - i0.ColumnOrderings get categoryId => i0.ColumnOrderings($table.category); - i0.ComposableOrdering category( - i0.ComposableOrdering Function($$CategoriesTableOrderingComposer o) o) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i2.ReadDatabaseContainer($db) - .resultSet('categories'), - getCurrentColumn: (f) => f.category, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$CategoriesTableOrderingComposer(db, table), - builder: o); - } - - i0.ColumnOrderings get dueDate => - i0.ColumnOrderings($table.dueDate); -} - -class $$TodoItemsTableProcessedTableManager extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$TodoItemsTable, - i1.TodoItem, - $$TodoItemsTableFilterComposer, - $$TodoItemsTableOrderingComposer, - $$TodoItemsTableProcessedTableManager, - $$TodoItemsTableInsertCompanionBuilder, - $$TodoItemsTableUpdateCompanionBuilder> { - const $$TodoItemsTableProcessedTableManager(super.$state); -} - -typedef $$TodoItemsTableInsertCompanionBuilder = i1.TodoItemsCompanion - Function({ - i0.Value id, - required String title, - required String content, - i0.Value category, - i0.Value dueDate, -}); -typedef $$TodoItemsTableUpdateCompanionBuilder = i1.TodoItemsCompanion - Function({ - i0.Value id, - i0.Value title, - i0.Value content, - i0.Value category, - i0.Value dueDate, -}); - -class $$TodoItemsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$TodoItemsTable, - i1.TodoItem, - $$TodoItemsTableFilterComposer, - $$TodoItemsTableOrderingComposer, - $$TodoItemsTableProcessedTableManager, - $$TodoItemsTableInsertCompanionBuilder, - $$TodoItemsTableUpdateCompanionBuilder> { - $$TodoItemsTableTableManager( - i0.GeneratedDatabase db, i1.$TodoItemsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$TodoItemsTableFilterComposer(db, table), - orderingComposer: $$TodoItemsTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$TodoItemsTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value title = const i0.Value.absent(), - i0.Value content = const i0.Value.absent(), - i0.Value category = const i0.Value.absent(), - i0.Value dueDate = const i0.Value.absent(), - }) => - i1.TodoItemsCompanion( - id: id, - title: title, - content: content, - category: category, - dueDate: dueDate, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required String title, - required String content, - i0.Value category = const i0.Value.absent(), - i0.Value dueDate = const i0.Value.absent(), - }) => - i1.TodoItemsCompanion.insert( - id: id, - title: title, - content: content, - category: category, - dueDate: dueDate, - ))); -} - class $MyDatabaseManager { final $MyDatabase _db; $MyDatabaseManager(this._db); - $$CategoriesTableTableManager get categories => - $$CategoriesTableTableManager(_db, _db.categories); - $$TodoItemsTableTableManager get todoItems => - $$TodoItemsTableTableManager(_db, _db.todoItems); + i1.$$CategoriesTableTableManager get categories => + i1.$$CategoriesTableTableManager(_db, _db.categories); + i1.$$TodoItemsTableTableManager get todoItems => + i1.$$TodoItemsTableTableManager(_db, _db.todoItems); } class CategoriesWithCountResult { diff --git a/docs/lib/snippets/modular/custom_types/drift_table.drift.dart b/docs/lib/snippets/modular/custom_types/drift_table.drift.dart index ec98429e..ef63b34e 100644 --- a/docs/lib/snippets/modular/custom_types/drift_table.drift.dart +++ b/docs/lib/snippets/modular/custom_types/drift_table.drift.dart @@ -222,3 +222,87 @@ class PeriodicRemindersCompanion .toString(); } } + +class $PeriodicRemindersFilterComposer + extends i0.FilterComposer { + $PeriodicRemindersFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get frequency => + i0.ColumnFilters($table.frequency); + i0.ColumnFilters get reminder => i0.ColumnFilters($table.reminder); +} + +class $PeriodicRemindersOrderingComposer + extends i0.OrderingComposer { + $PeriodicRemindersOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get frequency => + i0.ColumnOrderings($table.frequency); + i0.ColumnOrderings get reminder => + i0.ColumnOrderings($table.reminder); +} + +class $PeriodicRemindersProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.PeriodicReminders, + i1.PeriodicReminder, + $PeriodicRemindersFilterComposer, + $PeriodicRemindersOrderingComposer, + $PeriodicRemindersProcessedTableManager, + $PeriodicRemindersInsertCompanionBuilder, + $PeriodicRemindersUpdateCompanionBuilder> { + const $PeriodicRemindersProcessedTableManager(super.$state); +} + +typedef $PeriodicRemindersInsertCompanionBuilder = i1.PeriodicRemindersCompanion + Function({ + i0.Value id, + required Duration frequency, + required String reminder, +}); +typedef $PeriodicRemindersUpdateCompanionBuilder = i1.PeriodicRemindersCompanion + Function({ + i0.Value id, + i0.Value frequency, + i0.Value reminder, +}); + +class $PeriodicRemindersTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.PeriodicReminders, + i1.PeriodicReminder, + $PeriodicRemindersFilterComposer, + $PeriodicRemindersOrderingComposer, + $PeriodicRemindersProcessedTableManager, + $PeriodicRemindersInsertCompanionBuilder, + $PeriodicRemindersUpdateCompanionBuilder> { + $PeriodicRemindersTableManager( + i0.GeneratedDatabase db, i1.PeriodicReminders table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $PeriodicRemindersFilterComposer(db, table), + orderingComposer: $PeriodicRemindersOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $PeriodicRemindersProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value frequency = const i0.Value.absent(), + i0.Value reminder = const i0.Value.absent(), + }) => + i1.PeriodicRemindersCompanion( + id: id, + frequency: frequency, + reminder: reminder, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required Duration frequency, + required String reminder, + }) => + i1.PeriodicRemindersCompanion.insert( + id: id, + frequency: frequency, + reminder: reminder, + ))); +} diff --git a/docs/lib/snippets/modular/custom_types/table.drift.dart b/docs/lib/snippets/modular/custom_types/table.drift.dart index a0a0b647..fd7e9b48 100644 --- a/docs/lib/snippets/modular/custom_types/table.drift.dart +++ b/docs/lib/snippets/modular/custom_types/table.drift.dart @@ -220,3 +220,90 @@ class PeriodicRemindersCompanion .toString(); } } + +class $$PeriodicRemindersTableFilterComposer extends i0 + .FilterComposer { + $$PeriodicRemindersTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get frequency => + i0.ColumnFilters($table.frequency); + i0.ColumnFilters get reminder => i0.ColumnFilters($table.reminder); +} + +class $$PeriodicRemindersTableOrderingComposer extends i0 + .OrderingComposer { + $$PeriodicRemindersTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get frequency => + i0.ColumnOrderings($table.frequency); + i0.ColumnOrderings get reminder => + i0.ColumnOrderings($table.reminder); +} + +class $$PeriodicRemindersTableProcessedTableManager + extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$PeriodicRemindersTable, + i1.PeriodicReminder, + $$PeriodicRemindersTableFilterComposer, + $$PeriodicRemindersTableOrderingComposer, + $$PeriodicRemindersTableProcessedTableManager, + $$PeriodicRemindersTableInsertCompanionBuilder, + $$PeriodicRemindersTableUpdateCompanionBuilder> { + const $$PeriodicRemindersTableProcessedTableManager(super.$state); +} + +typedef $$PeriodicRemindersTableInsertCompanionBuilder + = i1.PeriodicRemindersCompanion Function({ + i0.Value id, + i0.Value frequency, + required String reminder, +}); +typedef $$PeriodicRemindersTableUpdateCompanionBuilder + = i1.PeriodicRemindersCompanion Function({ + i0.Value id, + i0.Value frequency, + i0.Value reminder, +}); + +class $$PeriodicRemindersTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$PeriodicRemindersTable, + i1.PeriodicReminder, + $$PeriodicRemindersTableFilterComposer, + $$PeriodicRemindersTableOrderingComposer, + $$PeriodicRemindersTableProcessedTableManager, + $$PeriodicRemindersTableInsertCompanionBuilder, + $$PeriodicRemindersTableUpdateCompanionBuilder> { + $$PeriodicRemindersTableTableManager( + i0.GeneratedDatabase db, i1.$PeriodicRemindersTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: + $$PeriodicRemindersTableFilterComposer(db, table), + orderingComposer: + $$PeriodicRemindersTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$PeriodicRemindersTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value frequency = const i0.Value.absent(), + i0.Value reminder = const i0.Value.absent(), + }) => + i1.PeriodicRemindersCompanion( + id: id, + frequency: frequency, + reminder: reminder, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value frequency = const i0.Value.absent(), + required String reminder, + }) => + i1.PeriodicRemindersCompanion.insert( + id: id, + frequency: frequency, + reminder: reminder, + ))); +} diff --git a/docs/lib/snippets/modular/drift/example.drift.dart b/docs/lib/snippets/modular/drift/example.drift.dart index 1cf7c677..6b5e8711 100644 --- a/docs/lib/snippets/modular/drift/example.drift.dart +++ b/docs/lib/snippets/modular/drift/example.drift.dart @@ -259,6 +259,117 @@ class TodosCompanion extends i0.UpdateCompanion { } } +class $TodosFilterComposer + extends i0.FilterComposer { + $TodosFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get title => i0.ColumnFilters($table.title); + i0.ColumnFilters get content => i0.ColumnFilters($table.content); + i0.ColumnFilters get categoryId => i0.ColumnFilters($table.category); + i0.ComposableFilter category( + i0.ComposableFilter Function(i1.$CategoriesFilterComposer f) f) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i2.ReadDatabaseContainer($db) + .resultSet('categories'), + getCurrentColumn: (f) => f.category, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$CategoriesFilterComposer(db, table), + builder: f); + } +} + +class $TodosOrderingComposer + extends i0.OrderingComposer { + $TodosOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get title => i0.ColumnOrderings($table.title); + i0.ColumnOrderings get content => i0.ColumnOrderings($table.content); + i0.ColumnOrderings get categoryId => i0.ColumnOrderings($table.category); + i0.ComposableOrdering category( + i0.ComposableOrdering Function(i1.$CategoriesOrderingComposer o) o) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i2.ReadDatabaseContainer($db) + .resultSet('categories'), + getCurrentColumn: (f) => f.category, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$CategoriesOrderingComposer(db, table), + builder: o); + } +} + +class $TodosProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Todos, + i1.Todo, + $TodosFilterComposer, + $TodosOrderingComposer, + $TodosProcessedTableManager, + $TodosInsertCompanionBuilder, + $TodosUpdateCompanionBuilder> { + const $TodosProcessedTableManager(super.$state); +} + +typedef $TodosInsertCompanionBuilder = i1.TodosCompanion Function({ + i0.Value id, + required String title, + required String content, + i0.Value category, +}); +typedef $TodosUpdateCompanionBuilder = i1.TodosCompanion Function({ + i0.Value id, + i0.Value title, + i0.Value content, + i0.Value category, +}); + +class $TodosTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.Todos, + i1.Todo, + $TodosFilterComposer, + $TodosOrderingComposer, + $TodosProcessedTableManager, + $TodosInsertCompanionBuilder, + $TodosUpdateCompanionBuilder> { + $TodosTableManager(i0.GeneratedDatabase db, i1.Todos table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $TodosFilterComposer(db, table), + orderingComposer: $TodosOrderingComposer(db, table), + getChildManagerBuilder: (p0) => $TodosProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value title = const i0.Value.absent(), + i0.Value content = const i0.Value.absent(), + i0.Value category = const i0.Value.absent(), + }) => + i1.TodosCompanion( + id: id, + title: title, + content: content, + category: category, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String title, + required String content, + i0.Value category = const i0.Value.absent(), + }) => + i1.TodosCompanion.insert( + id: id, + title: title, + content: content, + category: category, + ))); +} + class Categories extends i0.Table with i0.TableInfo { @override final i0.GeneratedDatabase attachedDatabase; @@ -436,6 +547,78 @@ class CategoriesCompanion extends i0.UpdateCompanion { } } +class $CategoriesFilterComposer + extends i0.FilterComposer { + $CategoriesFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get description => + i0.ColumnFilters($table.description); +} + +class $CategoriesOrderingComposer + extends i0.OrderingComposer { + $CategoriesOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get description => + i0.ColumnOrderings($table.description); +} + +class $CategoriesProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.Categories, + i1.Category, + $CategoriesFilterComposer, + $CategoriesOrderingComposer, + $CategoriesProcessedTableManager, + $CategoriesInsertCompanionBuilder, + $CategoriesUpdateCompanionBuilder> { + const $CategoriesProcessedTableManager(super.$state); +} + +typedef $CategoriesInsertCompanionBuilder = i1.CategoriesCompanion Function({ + i0.Value id, + required String description, +}); +typedef $CategoriesUpdateCompanionBuilder = i1.CategoriesCompanion Function({ + i0.Value id, + i0.Value description, +}); + +class $CategoriesTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.Categories, + i1.Category, + $CategoriesFilterComposer, + $CategoriesOrderingComposer, + $CategoriesProcessedTableManager, + $CategoriesInsertCompanionBuilder, + $CategoriesUpdateCompanionBuilder> { + $CategoriesTableManager(i0.GeneratedDatabase db, i1.Categories table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $CategoriesFilterComposer(db, table), + orderingComposer: $CategoriesOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $CategoriesProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + }) => + i1.CategoriesCompanion( + id: id, + description: description, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String description, + }) => + i1.CategoriesCompanion.insert( + id: id, + description: description, + ))); +} + class ExampleDrift extends i2.ModularAccessor { ExampleDrift(i0.GeneratedDatabase db) : super(db); i0.Selectable filterTodos(FilterTodos$predicate predicate) { diff --git a/docs/lib/snippets/modular/drift/with_existing.drift.dart b/docs/lib/snippets/modular/drift/with_existing.drift.dart index a1c42054..511452df 100644 --- a/docs/lib/snippets/modular/drift/with_existing.drift.dart +++ b/docs/lib/snippets/modular/drift/with_existing.drift.dart @@ -310,6 +310,81 @@ class FriendsCompanion extends i0.UpdateCompanion { } } +class $FriendsFilterComposer + extends i0.FilterComposer { + $FriendsFilterComposer(super.db, super.table); + i0.ColumnFilters get userAId => i0.ColumnFilters($table.userA); + i0.ColumnFilters get userBId => i0.ColumnFilters($table.userB); +} + +class $FriendsOrderingComposer + extends i0.OrderingComposer { + $FriendsOrderingComposer(super.db, super.table); + i0.ColumnOrderings get userAId => i0.ColumnOrderings($table.userA); + i0.ColumnOrderings get userBId => i0.ColumnOrderings($table.userB); +} + +class $FriendsProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i2.Friends, + i2.Friend, + $FriendsFilterComposer, + $FriendsOrderingComposer, + $FriendsProcessedTableManager, + $FriendsInsertCompanionBuilder, + $FriendsUpdateCompanionBuilder> { + const $FriendsProcessedTableManager(super.$state); +} + +typedef $FriendsInsertCompanionBuilder = i2.FriendsCompanion Function({ + required int userA, + required int userB, + i0.Value rowid, +}); +typedef $FriendsUpdateCompanionBuilder = i2.FriendsCompanion Function({ + i0.Value userA, + i0.Value userB, + i0.Value rowid, +}); + +class $FriendsTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i2.Friends, + i2.Friend, + $FriendsFilterComposer, + $FriendsOrderingComposer, + $FriendsProcessedTableManager, + $FriendsInsertCompanionBuilder, + $FriendsUpdateCompanionBuilder> { + $FriendsTableManager(i0.GeneratedDatabase db, i2.Friends table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $FriendsFilterComposer(db, table), + orderingComposer: $FriendsOrderingComposer(db, table), + getChildManagerBuilder: (p0) => $FriendsProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value userA = const i0.Value.absent(), + i0.Value userB = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => + i2.FriendsCompanion( + userA: userA, + userB: userB, + rowid: rowid, + ), + getInsertCompanionBuilder: ({ + required int userA, + required int userB, + i0.Value rowid = const i0.Value.absent(), + }) => + i2.FriendsCompanion.insert( + userA: userA, + userB: userB, + rowid: rowid, + ))); +} + class WithExistingDrift extends i3.ModularAccessor { WithExistingDrift(i0.GeneratedDatabase db) : super(db); i0.Selectable allFriendsOf(int id) { diff --git a/docs/lib/snippets/modular/many_to_many/json.drift.dart b/docs/lib/snippets/modular/many_to_many/json.drift.dart index e83c4267..ee2709a4 100644 --- a/docs/lib/snippets/modular/many_to_many/json.drift.dart +++ b/docs/lib/snippets/modular/many_to_many/json.drift.dart @@ -19,175 +19,13 @@ abstract class $JsonBasedDatabase extends i0.GeneratedDatabase { [buyableItems, shoppingCarts]; } -class $$BuyableItemsTableFilterComposer - extends i0.FilterComposer { - $$BuyableItemsTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ColumnFilters get description => - i0.ColumnFilters($table.description); - i0.ColumnFilters get price => i0.ColumnFilters($table.price); -} - -class $$BuyableItemsTableOrderingComposer - extends i0.OrderingComposer { - $$BuyableItemsTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); - i0.ColumnOrderings get description => - i0.ColumnOrderings($table.description); - i0.ColumnOrderings get price => i0.ColumnOrderings($table.price); -} - -class $$BuyableItemsTableProcessedTableManager extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$BuyableItemsTable, - i1.BuyableItem, - $$BuyableItemsTableFilterComposer, - $$BuyableItemsTableOrderingComposer, - $$BuyableItemsTableProcessedTableManager, - $$BuyableItemsTableInsertCompanionBuilder, - $$BuyableItemsTableUpdateCompanionBuilder> { - const $$BuyableItemsTableProcessedTableManager(super.$state); -} - -typedef $$BuyableItemsTableInsertCompanionBuilder = i1.BuyableItemsCompanion - Function({ - i0.Value id, - required String description, - required int price, -}); -typedef $$BuyableItemsTableUpdateCompanionBuilder = i1.BuyableItemsCompanion - Function({ - i0.Value id, - i0.Value description, - i0.Value price, -}); - -class $$BuyableItemsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$BuyableItemsTable, - i1.BuyableItem, - $$BuyableItemsTableFilterComposer, - $$BuyableItemsTableOrderingComposer, - $$BuyableItemsTableProcessedTableManager, - $$BuyableItemsTableInsertCompanionBuilder, - $$BuyableItemsTableUpdateCompanionBuilder> { - $$BuyableItemsTableTableManager( - i0.GeneratedDatabase db, i1.$BuyableItemsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$BuyableItemsTableFilterComposer(db, table), - orderingComposer: $$BuyableItemsTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$BuyableItemsTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value price = const i0.Value.absent(), - }) => - i1.BuyableItemsCompanion( - id: id, - description: description, - price: price, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required String description, - required int price, - }) => - i1.BuyableItemsCompanion.insert( - id: id, - description: description, - price: price, - ))); -} - -class $$ShoppingCartsTableFilterComposer - extends i0.FilterComposer { - $$ShoppingCartsTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ColumnFilters get entriesValue => i0.ColumnFilters($table.entries); - i0.ColumnWithTypeConverterFilters< - i3.ShoppingCartEntries, - i3.ShoppingCartEntries, - String> get entries => i0.ColumnWithTypeConverterFilters($table.entries); -} - -class $$ShoppingCartsTableOrderingComposer - extends i0.OrderingComposer { - $$ShoppingCartsTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); - i0.ColumnOrderings get entries => i0.ColumnOrderings($table.entries); -} - -class $$ShoppingCartsTableProcessedTableManager - extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartsTable, - i2.ShoppingCart, - $$ShoppingCartsTableFilterComposer, - $$ShoppingCartsTableOrderingComposer, - $$ShoppingCartsTableProcessedTableManager, - $$ShoppingCartsTableInsertCompanionBuilder, - $$ShoppingCartsTableUpdateCompanionBuilder> { - const $$ShoppingCartsTableProcessedTableManager(super.$state); -} - -typedef $$ShoppingCartsTableInsertCompanionBuilder = i2.ShoppingCartsCompanion - Function({ - i0.Value id, - required i3.ShoppingCartEntries entries, -}); -typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion - Function({ - i0.Value id, - i0.Value entries, -}); - -class $$ShoppingCartsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartsTable, - i2.ShoppingCart, - $$ShoppingCartsTableFilterComposer, - $$ShoppingCartsTableOrderingComposer, - $$ShoppingCartsTableProcessedTableManager, - $$ShoppingCartsTableInsertCompanionBuilder, - $$ShoppingCartsTableUpdateCompanionBuilder> { - $$ShoppingCartsTableTableManager( - i0.GeneratedDatabase db, i2.$ShoppingCartsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$ShoppingCartsTableFilterComposer(db, table), - orderingComposer: $$ShoppingCartsTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$ShoppingCartsTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value entries = - const i0.Value.absent(), - }) => - i2.ShoppingCartsCompanion( - id: id, - entries: entries, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required i3.ShoppingCartEntries entries, - }) => - i2.ShoppingCartsCompanion.insert( - id: id, - entries: entries, - ))); -} - class $JsonBasedDatabaseManager { final $JsonBasedDatabase _db; $JsonBasedDatabaseManager(this._db); - $$BuyableItemsTableTableManager get buyableItems => - $$BuyableItemsTableTableManager(_db, _db.buyableItems); - $$ShoppingCartsTableTableManager get shoppingCarts => - $$ShoppingCartsTableTableManager(_db, _db.shoppingCarts); + i1.$$BuyableItemsTableTableManager get buyableItems => + i1.$$BuyableItemsTableTableManager(_db, _db.buyableItems); + i2.$$ShoppingCartsTableTableManager get shoppingCarts => + i2.$$ShoppingCartsTableTableManager(_db, _db.shoppingCarts); } class $ShoppingCartsTable extends i3.ShoppingCarts @@ -373,3 +211,82 @@ class ShoppingCartsCompanion extends i0.UpdateCompanion { .toString(); } } + +class $$ShoppingCartsTableFilterComposer + extends i0.FilterComposer { + $$ShoppingCartsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get entriesValue => i0.ColumnFilters($table.entries); + i0.ColumnWithTypeConverterFilters< + i3.ShoppingCartEntries, + i3.ShoppingCartEntries, + String> get entries => i0.ColumnWithTypeConverterFilters($table.entries); +} + +class $$ShoppingCartsTableOrderingComposer + extends i0.OrderingComposer { + $$ShoppingCartsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get entries => i0.ColumnOrderings($table.entries); +} + +class $$ShoppingCartsTableProcessedTableManager + extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartsTable, + i2.ShoppingCart, + $$ShoppingCartsTableFilterComposer, + $$ShoppingCartsTableOrderingComposer, + $$ShoppingCartsTableProcessedTableManager, + $$ShoppingCartsTableInsertCompanionBuilder, + $$ShoppingCartsTableUpdateCompanionBuilder> { + const $$ShoppingCartsTableProcessedTableManager(super.$state); +} + +typedef $$ShoppingCartsTableInsertCompanionBuilder = i2.ShoppingCartsCompanion + Function({ + i0.Value id, + required i3.ShoppingCartEntries entries, +}); +typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion + Function({ + i0.Value id, + i0.Value entries, +}); + +class $$ShoppingCartsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartsTable, + i2.ShoppingCart, + $$ShoppingCartsTableFilterComposer, + $$ShoppingCartsTableOrderingComposer, + $$ShoppingCartsTableProcessedTableManager, + $$ShoppingCartsTableInsertCompanionBuilder, + $$ShoppingCartsTableUpdateCompanionBuilder> { + $$ShoppingCartsTableTableManager( + i0.GeneratedDatabase db, i2.$ShoppingCartsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$ShoppingCartsTableFilterComposer(db, table), + orderingComposer: $$ShoppingCartsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$ShoppingCartsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value entries = + const i0.Value.absent(), + }) => + i2.ShoppingCartsCompanion( + id: id, + entries: entries, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required i3.ShoppingCartEntries entries, + }) => + i2.ShoppingCartsCompanion.insert( + id: id, + entries: entries, + ))); +} diff --git a/docs/lib/snippets/modular/many_to_many/relational.drift.dart b/docs/lib/snippets/modular/many_to_many/relational.drift.dart index 100d677e..abb192f9 100644 --- a/docs/lib/snippets/modular/many_to_many/relational.drift.dart +++ b/docs/lib/snippets/modular/many_to_many/relational.drift.dart @@ -4,8 +4,8 @@ import 'package:drift_docs/snippets/modular/many_to_many/shared.drift.dart' as i1; import 'package:drift_docs/snippets/modular/many_to_many/relational.drift.dart' as i2; -import 'package:drift/internal/modular.dart' as i3; -import 'package:drift_docs/snippets/modular/many_to_many/relational.dart' as i4; +import 'package:drift_docs/snippets/modular/many_to_many/relational.dart' as i3; +import 'package:drift/internal/modular.dart' as i4; abstract class $RelationalDatabase extends i0.GeneratedDatabase { $RelationalDatabase(i0.QueryExecutor e) : super(e); @@ -23,334 +23,18 @@ abstract class $RelationalDatabase extends i0.GeneratedDatabase { [buyableItems, shoppingCarts, shoppingCartEntries]; } -class $$BuyableItemsTableFilterComposer - extends i0.FilterComposer { - $$BuyableItemsTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ColumnFilters get description => - i0.ColumnFilters($table.description); - i0.ColumnFilters get price => i0.ColumnFilters($table.price); - i0.ComposableFilter shoppingCartEntriesRefs( - i0.ComposableFilter Function($$ShoppingCartEntriesTableFilterComposer f) - f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('shopping_cart_entries'), - getCurrentColumn: (f) => f.id, - getReferencedColumn: (f) => f.item, - getReferencedComposer: (db, table) => - $$ShoppingCartEntriesTableFilterComposer(db, table), - builder: f); - } -} - -class $$BuyableItemsTableOrderingComposer - extends i0.OrderingComposer { - $$BuyableItemsTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); - i0.ColumnOrderings get description => - i0.ColumnOrderings($table.description); - i0.ColumnOrderings get price => i0.ColumnOrderings($table.price); -} - -class $$BuyableItemsTableProcessedTableManager extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i1.$BuyableItemsTable, - i1.BuyableItem, - $$BuyableItemsTableFilterComposer, - $$BuyableItemsTableOrderingComposer, - $$BuyableItemsTableProcessedTableManager, - $$BuyableItemsTableInsertCompanionBuilder, - $$BuyableItemsTableUpdateCompanionBuilder> { - const $$BuyableItemsTableProcessedTableManager(super.$state); -} - -typedef $$BuyableItemsTableInsertCompanionBuilder = i1.BuyableItemsCompanion - Function({ - i0.Value id, - required String description, - required int price, -}); -typedef $$BuyableItemsTableUpdateCompanionBuilder = i1.BuyableItemsCompanion - Function({ - i0.Value id, - i0.Value description, - i0.Value price, -}); - -class $$BuyableItemsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i1.$BuyableItemsTable, - i1.BuyableItem, - $$BuyableItemsTableFilterComposer, - $$BuyableItemsTableOrderingComposer, - $$BuyableItemsTableProcessedTableManager, - $$BuyableItemsTableInsertCompanionBuilder, - $$BuyableItemsTableUpdateCompanionBuilder> { - $$BuyableItemsTableTableManager( - i0.GeneratedDatabase db, i1.$BuyableItemsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$BuyableItemsTableFilterComposer(db, table), - orderingComposer: $$BuyableItemsTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$BuyableItemsTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - i0.Value description = const i0.Value.absent(), - i0.Value price = const i0.Value.absent(), - }) => - i1.BuyableItemsCompanion( - id: id, - description: description, - price: price, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - required String description, - required int price, - }) => - i1.BuyableItemsCompanion.insert( - id: id, - description: description, - price: price, - ))); -} - -class $$ShoppingCartsTableFilterComposer - extends i0.FilterComposer { - $$ShoppingCartsTableFilterComposer(super.db, super.table); - i0.ColumnFilters get id => i0.ColumnFilters($table.id); - i0.ComposableFilter shoppingCartEntriesRefs( - i0.ComposableFilter Function($$ShoppingCartEntriesTableFilterComposer f) - f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('shopping_cart_entries'), - getCurrentColumn: (f) => f.id, - getReferencedColumn: (f) => f.shoppingCart, - getReferencedComposer: (db, table) => - $$ShoppingCartEntriesTableFilterComposer(db, table), - builder: f); - } -} - -class $$ShoppingCartsTableOrderingComposer - extends i0.OrderingComposer { - $$ShoppingCartsTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); -} - -class $$ShoppingCartsTableProcessedTableManager - extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartsTable, - i2.ShoppingCart, - $$ShoppingCartsTableFilterComposer, - $$ShoppingCartsTableOrderingComposer, - $$ShoppingCartsTableProcessedTableManager, - $$ShoppingCartsTableInsertCompanionBuilder, - $$ShoppingCartsTableUpdateCompanionBuilder> { - const $$ShoppingCartsTableProcessedTableManager(super.$state); -} - -typedef $$ShoppingCartsTableInsertCompanionBuilder = i2.ShoppingCartsCompanion - Function({ - i0.Value id, -}); -typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion - Function({ - i0.Value id, -}); - -class $$ShoppingCartsTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartsTable, - i2.ShoppingCart, - $$ShoppingCartsTableFilterComposer, - $$ShoppingCartsTableOrderingComposer, - $$ShoppingCartsTableProcessedTableManager, - $$ShoppingCartsTableInsertCompanionBuilder, - $$ShoppingCartsTableUpdateCompanionBuilder> { - $$ShoppingCartsTableTableManager( - i0.GeneratedDatabase db, i2.$ShoppingCartsTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: $$ShoppingCartsTableFilterComposer(db, table), - orderingComposer: $$ShoppingCartsTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$ShoppingCartsTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - }) => - i2.ShoppingCartsCompanion( - id: id, - ), - getInsertCompanionBuilder: ({ - i0.Value id = const i0.Value.absent(), - }) => - i2.ShoppingCartsCompanion.insert( - id: id, - ))); -} - -class $$ShoppingCartEntriesTableFilterComposer extends i0 - .FilterComposer { - $$ShoppingCartEntriesTableFilterComposer(super.db, super.table); - i0.ColumnFilters get shoppingCartId => - i0.ColumnFilters($table.shoppingCart); - i0.ComposableFilter shoppingCart( - i0.ComposableFilter Function($$ShoppingCartsTableFilterComposer f) f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('shopping_carts'), - getCurrentColumn: (f) => f.shoppingCart, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$ShoppingCartsTableFilterComposer(db, table), - builder: f); - } - - i0.ColumnFilters get itemId => i0.ColumnFilters($table.item); - i0.ComposableFilter item( - i0.ComposableFilter Function($$BuyableItemsTableFilterComposer f) f) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('buyable_items'), - getCurrentColumn: (f) => f.item, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$BuyableItemsTableFilterComposer(db, table), - builder: f); - } -} - -class $$ShoppingCartEntriesTableOrderingComposer extends i0 - .OrderingComposer { - $$ShoppingCartEntriesTableOrderingComposer(super.db, super.table); - i0.ColumnOrderings get shoppingCartId => - i0.ColumnOrderings($table.shoppingCart); - i0.ComposableOrdering shoppingCart( - i0.ComposableOrdering Function($$ShoppingCartsTableOrderingComposer o) - o) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('shopping_carts'), - getCurrentColumn: (f) => f.shoppingCart, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$ShoppingCartsTableOrderingComposer(db, table), - builder: o); - } - - i0.ColumnOrderings get itemId => i0.ColumnOrderings($table.item); - i0.ComposableOrdering item( - i0.ComposableOrdering Function($$BuyableItemsTableOrderingComposer o) o) { - return $composeWithJoins( - $db: $db, - $table: $table, - referencedTable: i3.ReadDatabaseContainer($db) - .resultSet('buyable_items'), - getCurrentColumn: (f) => f.item, - getReferencedColumn: (f) => f.id, - getReferencedComposer: (db, table) => - $$BuyableItemsTableOrderingComposer(db, table), - builder: o); - } -} - -class $$ShoppingCartEntriesTableProcessedTableManager - extends i0.ProcessedTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartEntriesTable, - i2.ShoppingCartEntry, - $$ShoppingCartEntriesTableFilterComposer, - $$ShoppingCartEntriesTableOrderingComposer, - $$ShoppingCartEntriesTableProcessedTableManager, - $$ShoppingCartEntriesTableInsertCompanionBuilder, - $$ShoppingCartEntriesTableUpdateCompanionBuilder> { - const $$ShoppingCartEntriesTableProcessedTableManager(super.$state); -} - -typedef $$ShoppingCartEntriesTableInsertCompanionBuilder - = i2.ShoppingCartEntriesCompanion Function({ - required int shoppingCart, - required int item, - i0.Value rowid, -}); -typedef $$ShoppingCartEntriesTableUpdateCompanionBuilder - = i2.ShoppingCartEntriesCompanion Function({ - i0.Value shoppingCart, - i0.Value item, - i0.Value rowid, -}); - -class $$ShoppingCartEntriesTableTableManager extends i0.RootTableManager< - i0.GeneratedDatabase, - i2.$ShoppingCartEntriesTable, - i2.ShoppingCartEntry, - $$ShoppingCartEntriesTableFilterComposer, - $$ShoppingCartEntriesTableOrderingComposer, - $$ShoppingCartEntriesTableProcessedTableManager, - $$ShoppingCartEntriesTableInsertCompanionBuilder, - $$ShoppingCartEntriesTableUpdateCompanionBuilder> { - $$ShoppingCartEntriesTableTableManager( - i0.GeneratedDatabase db, i2.$ShoppingCartEntriesTable table) - : super(i0.TableManagerState( - db: db, - table: table, - filteringComposer: - $$ShoppingCartEntriesTableFilterComposer(db, table), - orderingComposer: - $$ShoppingCartEntriesTableOrderingComposer(db, table), - getChildManagerBuilder: (p0) => - $$ShoppingCartEntriesTableProcessedTableManager(p0), - getUpdateCompanionBuilder: ({ - i0.Value shoppingCart = const i0.Value.absent(), - i0.Value item = const i0.Value.absent(), - i0.Value rowid = const i0.Value.absent(), - }) => - i2.ShoppingCartEntriesCompanion( - shoppingCart: shoppingCart, - item: item, - rowid: rowid, - ), - getInsertCompanionBuilder: ({ - required int shoppingCart, - required int item, - i0.Value rowid = const i0.Value.absent(), - }) => - i2.ShoppingCartEntriesCompanion.insert( - shoppingCart: shoppingCart, - item: item, - rowid: rowid, - ))); -} - class $RelationalDatabaseManager { final $RelationalDatabase _db; $RelationalDatabaseManager(this._db); - $$BuyableItemsTableTableManager get buyableItems => - $$BuyableItemsTableTableManager(_db, _db.buyableItems); - $$ShoppingCartsTableTableManager get shoppingCarts => - $$ShoppingCartsTableTableManager(_db, _db.shoppingCarts); - $$ShoppingCartEntriesTableTableManager get shoppingCartEntries => - $$ShoppingCartEntriesTableTableManager(_db, _db.shoppingCartEntries); + i1.$$BuyableItemsTableTableManager get buyableItems => + i1.$$BuyableItemsTableTableManager(_db, _db.buyableItems); + i2.$$ShoppingCartsTableTableManager get shoppingCarts => + i2.$$ShoppingCartsTableTableManager(_db, _db.shoppingCarts); + i2.$$ShoppingCartEntriesTableTableManager get shoppingCartEntries => + i2.$$ShoppingCartEntriesTableTableManager(_db, _db.shoppingCartEntries); } -class $ShoppingCartsTable extends i4.ShoppingCarts +class $ShoppingCartsTable extends i3.ShoppingCarts with i0.TableInfo<$ShoppingCartsTable, i2.ShoppingCart> { @override final i0.GeneratedDatabase attachedDatabase; @@ -492,7 +176,73 @@ class ShoppingCartsCompanion extends i0.UpdateCompanion { } } -class $ShoppingCartEntriesTable extends i4.ShoppingCartEntries +class $$ShoppingCartsTableFilterComposer + extends i0.FilterComposer { + $$ShoppingCartsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); +} + +class $$ShoppingCartsTableOrderingComposer + extends i0.OrderingComposer { + $$ShoppingCartsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); +} + +class $$ShoppingCartsTableProcessedTableManager + extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartsTable, + i2.ShoppingCart, + $$ShoppingCartsTableFilterComposer, + $$ShoppingCartsTableOrderingComposer, + $$ShoppingCartsTableProcessedTableManager, + $$ShoppingCartsTableInsertCompanionBuilder, + $$ShoppingCartsTableUpdateCompanionBuilder> { + const $$ShoppingCartsTableProcessedTableManager(super.$state); +} + +typedef $$ShoppingCartsTableInsertCompanionBuilder = i2.ShoppingCartsCompanion + Function({ + i0.Value id, +}); +typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion + Function({ + i0.Value id, +}); + +class $$ShoppingCartsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartsTable, + i2.ShoppingCart, + $$ShoppingCartsTableFilterComposer, + $$ShoppingCartsTableOrderingComposer, + $$ShoppingCartsTableProcessedTableManager, + $$ShoppingCartsTableInsertCompanionBuilder, + $$ShoppingCartsTableUpdateCompanionBuilder> { + $$ShoppingCartsTableTableManager( + i0.GeneratedDatabase db, i2.$ShoppingCartsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$ShoppingCartsTableFilterComposer(db, table), + orderingComposer: $$ShoppingCartsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$ShoppingCartsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + }) => + i2.ShoppingCartsCompanion( + id: id, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + }) => + i2.ShoppingCartsCompanion.insert( + id: id, + ))); +} + +class $ShoppingCartEntriesTable extends i3.ShoppingCartEntries with i0.TableInfo<$ShoppingCartEntriesTable, i2.ShoppingCartEntry> { @override final i0.GeneratedDatabase attachedDatabase; @@ -690,3 +440,143 @@ class ShoppingCartEntriesCompanion .toString(); } } + +class $$ShoppingCartEntriesTableFilterComposer extends i0 + .FilterComposer { + $$ShoppingCartEntriesTableFilterComposer(super.db, super.table); + i0.ColumnFilters get shoppingCartId => + i0.ColumnFilters($table.shoppingCart); + i0.ComposableFilter shoppingCart( + i0.ComposableFilter Function(i2.$$ShoppingCartsTableFilterComposer f) f) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i4.ReadDatabaseContainer($db) + .resultSet('shopping_carts'), + getCurrentColumn: (f) => f.shoppingCart, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i2.$$ShoppingCartsTableFilterComposer(db, table), + builder: f); + } + + i0.ColumnFilters get itemId => i0.ColumnFilters($table.item); + i0.ComposableFilter item( + i0.ComposableFilter Function(i1.$$BuyableItemsTableFilterComposer f) f) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i4.ReadDatabaseContainer($db) + .resultSet('buyable_items'), + getCurrentColumn: (f) => f.item, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$$BuyableItemsTableFilterComposer(db, table), + builder: f); + } +} + +class $$ShoppingCartEntriesTableOrderingComposer extends i0 + .OrderingComposer { + $$ShoppingCartEntriesTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get shoppingCartId => + i0.ColumnOrderings($table.shoppingCart); + i0.ComposableOrdering shoppingCart( + i0.ComposableOrdering Function(i2.$$ShoppingCartsTableOrderingComposer o) + o) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i4.ReadDatabaseContainer($db) + .resultSet('shopping_carts'), + getCurrentColumn: (f) => f.shoppingCart, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i2.$$ShoppingCartsTableOrderingComposer(db, table), + builder: o); + } + + i0.ColumnOrderings get itemId => i0.ColumnOrderings($table.item); + i0.ComposableOrdering item( + i0.ComposableOrdering Function(i1.$$BuyableItemsTableOrderingComposer o) + o) { + return $composeWithJoins( + $db: $db, + $table: $table, + referencedTable: i4.ReadDatabaseContainer($db) + .resultSet('buyable_items'), + getCurrentColumn: (f) => f.item, + getReferencedColumn: (f) => f.id, + getReferencedComposer: (db, table) => + i1.$$BuyableItemsTableOrderingComposer(db, table), + builder: o); + } +} + +class $$ShoppingCartEntriesTableProcessedTableManager + extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartEntriesTable, + i2.ShoppingCartEntry, + $$ShoppingCartEntriesTableFilterComposer, + $$ShoppingCartEntriesTableOrderingComposer, + $$ShoppingCartEntriesTableProcessedTableManager, + $$ShoppingCartEntriesTableInsertCompanionBuilder, + $$ShoppingCartEntriesTableUpdateCompanionBuilder> { + const $$ShoppingCartEntriesTableProcessedTableManager(super.$state); +} + +typedef $$ShoppingCartEntriesTableInsertCompanionBuilder + = i2.ShoppingCartEntriesCompanion Function({ + required int shoppingCart, + required int item, + i0.Value rowid, +}); +typedef $$ShoppingCartEntriesTableUpdateCompanionBuilder + = i2.ShoppingCartEntriesCompanion Function({ + i0.Value shoppingCart, + i0.Value item, + i0.Value rowid, +}); + +class $$ShoppingCartEntriesTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i2.$ShoppingCartEntriesTable, + i2.ShoppingCartEntry, + $$ShoppingCartEntriesTableFilterComposer, + $$ShoppingCartEntriesTableOrderingComposer, + $$ShoppingCartEntriesTableProcessedTableManager, + $$ShoppingCartEntriesTableInsertCompanionBuilder, + $$ShoppingCartEntriesTableUpdateCompanionBuilder> { + $$ShoppingCartEntriesTableTableManager( + i0.GeneratedDatabase db, i2.$ShoppingCartEntriesTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: + $$ShoppingCartEntriesTableFilterComposer(db, table), + orderingComposer: + $$ShoppingCartEntriesTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$ShoppingCartEntriesTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value shoppingCart = const i0.Value.absent(), + i0.Value item = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => + i2.ShoppingCartEntriesCompanion( + shoppingCart: shoppingCart, + item: item, + rowid: rowid, + ), + getInsertCompanionBuilder: ({ + required int shoppingCart, + required int item, + i0.Value rowid = const i0.Value.absent(), + }) => + i2.ShoppingCartEntriesCompanion.insert( + shoppingCart: shoppingCart, + item: item, + rowid: rowid, + ))); +} diff --git a/docs/lib/snippets/modular/many_to_many/shared.drift.dart b/docs/lib/snippets/modular/many_to_many/shared.drift.dart index 52e441f9..8589b110 100644 --- a/docs/lib/snippets/modular/many_to_many/shared.drift.dart +++ b/docs/lib/snippets/modular/many_to_many/shared.drift.dart @@ -218,3 +218,86 @@ class BuyableItemsCompanion extends i0.UpdateCompanion { .toString(); } } + +class $$BuyableItemsTableFilterComposer + extends i0.FilterComposer { + $$BuyableItemsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get description => + i0.ColumnFilters($table.description); + i0.ColumnFilters get price => i0.ColumnFilters($table.price); +} + +class $$BuyableItemsTableOrderingComposer + extends i0.OrderingComposer { + $$BuyableItemsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get description => + i0.ColumnOrderings($table.description); + i0.ColumnOrderings get price => i0.ColumnOrderings($table.price); +} + +class $$BuyableItemsTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$BuyableItemsTable, + i1.BuyableItem, + $$BuyableItemsTableFilterComposer, + $$BuyableItemsTableOrderingComposer, + $$BuyableItemsTableProcessedTableManager, + $$BuyableItemsTableInsertCompanionBuilder, + $$BuyableItemsTableUpdateCompanionBuilder> { + const $$BuyableItemsTableProcessedTableManager(super.$state); +} + +typedef $$BuyableItemsTableInsertCompanionBuilder = i1.BuyableItemsCompanion + Function({ + i0.Value id, + required String description, + required int price, +}); +typedef $$BuyableItemsTableUpdateCompanionBuilder = i1.BuyableItemsCompanion + Function({ + i0.Value id, + i0.Value description, + i0.Value price, +}); + +class $$BuyableItemsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$BuyableItemsTable, + i1.BuyableItem, + $$BuyableItemsTableFilterComposer, + $$BuyableItemsTableOrderingComposer, + $$BuyableItemsTableProcessedTableManager, + $$BuyableItemsTableInsertCompanionBuilder, + $$BuyableItemsTableUpdateCompanionBuilder> { + $$BuyableItemsTableTableManager( + i0.GeneratedDatabase db, i1.$BuyableItemsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$BuyableItemsTableFilterComposer(db, table), + orderingComposer: $$BuyableItemsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$BuyableItemsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value description = const i0.Value.absent(), + i0.Value price = const i0.Value.absent(), + }) => + i1.BuyableItemsCompanion( + id: id, + description: description, + price: price, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String description, + required int price, + }) => + i1.BuyableItemsCompanion.insert( + id: id, + description: description, + price: price, + ))); +} diff --git a/docs/lib/snippets/modular/upserts.drift.dart b/docs/lib/snippets/modular/upserts.drift.dart index 977b6e89..60ff25df 100644 --- a/docs/lib/snippets/modular/upserts.drift.dart +++ b/docs/lib/snippets/modular/upserts.drift.dart @@ -187,6 +187,82 @@ class WordsCompanion extends i0.UpdateCompanion { } } +class $$WordsTableFilterComposer + extends i0.FilterComposer { + $$WordsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get word => i0.ColumnFilters($table.word); + i0.ColumnFilters get usages => i0.ColumnFilters($table.usages); +} + +class $$WordsTableOrderingComposer + extends i0.OrderingComposer { + $$WordsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get word => i0.ColumnOrderings($table.word); + i0.ColumnOrderings get usages => i0.ColumnOrderings($table.usages); +} + +class $$WordsTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$WordsTable, + i1.Word, + $$WordsTableFilterComposer, + $$WordsTableOrderingComposer, + $$WordsTableProcessedTableManager, + $$WordsTableInsertCompanionBuilder, + $$WordsTableUpdateCompanionBuilder> { + const $$WordsTableProcessedTableManager(super.$state); +} + +typedef $$WordsTableInsertCompanionBuilder = i1.WordsCompanion Function({ + required String word, + i0.Value usages, + i0.Value rowid, +}); +typedef $$WordsTableUpdateCompanionBuilder = i1.WordsCompanion Function({ + i0.Value word, + i0.Value usages, + i0.Value rowid, +}); + +class $$WordsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$WordsTable, + i1.Word, + $$WordsTableFilterComposer, + $$WordsTableOrderingComposer, + $$WordsTableProcessedTableManager, + $$WordsTableInsertCompanionBuilder, + $$WordsTableUpdateCompanionBuilder> { + $$WordsTableTableManager(i0.GeneratedDatabase db, i1.$WordsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$WordsTableFilterComposer(db, table), + orderingComposer: $$WordsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$WordsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value word = const i0.Value.absent(), + i0.Value usages = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => + i1.WordsCompanion( + word: word, + usages: usages, + rowid: rowid, + ), + getInsertCompanionBuilder: ({ + required String word, + i0.Value usages = const i0.Value.absent(), + i0.Value rowid = const i0.Value.absent(), + }) => + i1.WordsCompanion.insert( + word: word, + usages: usages, + rowid: rowid, + ))); +} + class $MatchResultsTable extends i2.MatchResults with i0.TableInfo<$MatchResultsTable, i1.MatchResult> { @override @@ -444,3 +520,92 @@ class MatchResultsCompanion extends i0.UpdateCompanion { .toString(); } } + +class $$MatchResultsTableFilterComposer + extends i0.FilterComposer { + $$MatchResultsTableFilterComposer(super.db, super.table); + i0.ColumnFilters get id => i0.ColumnFilters($table.id); + i0.ColumnFilters get teamA => i0.ColumnFilters($table.teamA); + i0.ColumnFilters get teamB => i0.ColumnFilters($table.teamB); + i0.ColumnFilters get teamAWon => i0.ColumnFilters($table.teamAWon); +} + +class $$MatchResultsTableOrderingComposer + extends i0.OrderingComposer { + $$MatchResultsTableOrderingComposer(super.db, super.table); + i0.ColumnOrderings get id => i0.ColumnOrderings($table.id); + i0.ColumnOrderings get teamA => i0.ColumnOrderings($table.teamA); + i0.ColumnOrderings get teamB => i0.ColumnOrderings($table.teamB); + i0.ColumnOrderings get teamAWon => i0.ColumnOrderings($table.teamAWon); +} + +class $$MatchResultsTableProcessedTableManager extends i0.ProcessedTableManager< + i0.GeneratedDatabase, + i1.$MatchResultsTable, + i1.MatchResult, + $$MatchResultsTableFilterComposer, + $$MatchResultsTableOrderingComposer, + $$MatchResultsTableProcessedTableManager, + $$MatchResultsTableInsertCompanionBuilder, + $$MatchResultsTableUpdateCompanionBuilder> { + const $$MatchResultsTableProcessedTableManager(super.$state); +} + +typedef $$MatchResultsTableInsertCompanionBuilder = i1.MatchResultsCompanion + Function({ + i0.Value id, + required String teamA, + required String teamB, + required bool teamAWon, +}); +typedef $$MatchResultsTableUpdateCompanionBuilder = i1.MatchResultsCompanion + Function({ + i0.Value id, + i0.Value teamA, + i0.Value teamB, + i0.Value teamAWon, +}); + +class $$MatchResultsTableTableManager extends i0.RootTableManager< + i0.GeneratedDatabase, + i1.$MatchResultsTable, + i1.MatchResult, + $$MatchResultsTableFilterComposer, + $$MatchResultsTableOrderingComposer, + $$MatchResultsTableProcessedTableManager, + $$MatchResultsTableInsertCompanionBuilder, + $$MatchResultsTableUpdateCompanionBuilder> { + $$MatchResultsTableTableManager( + i0.GeneratedDatabase db, i1.$MatchResultsTable table) + : super(i0.TableManagerState( + db: db, + table: table, + filteringComposer: $$MatchResultsTableFilterComposer(db, table), + orderingComposer: $$MatchResultsTableOrderingComposer(db, table), + getChildManagerBuilder: (p0) => + $$MatchResultsTableProcessedTableManager(p0), + getUpdateCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + i0.Value teamA = const i0.Value.absent(), + i0.Value teamB = const i0.Value.absent(), + i0.Value teamAWon = const i0.Value.absent(), + }) => + i1.MatchResultsCompanion( + id: id, + teamA: teamA, + teamB: teamB, + teamAWon: teamAWon, + ), + getInsertCompanionBuilder: ({ + i0.Value id = const i0.Value.absent(), + required String teamA, + required String teamB, + required bool teamAWon, + }) => + i1.MatchResultsCompanion.insert( + id: id, + teamA: teamA, + teamB: teamB, + teamAWon: teamAWon, + ))); +} diff --git a/drift_dev/lib/src/writer/manager_writer.dart b/drift_dev/lib/src/writer/manager_writer.dart index 8464dde2..02e0c8b0 100644 --- a/drift_dev/lib/src/writer/manager_writer.dart +++ b/drift_dev/lib/src/writer/manager_writer.dart @@ -497,7 +497,7 @@ class _TableManagerWriter { /// If this column is a foreign key to another table, add a filter and ordering /// for the referenced table - if (referenced != null) { + if (referenced != null && !referenced.$1.hasExistingRowClass) { final (referencedTable, referencedCol) = referenced; final referencedTableNames = _TableManagerWriter( referencedTable, scope, dbScope, databaseGenericName);