mirror of https://github.com/AMT-Cheif/drift.git
rebuild, format, and dart fix
This commit is contained in:
parent
1b2e8b7c75
commit
6a693a9016
|
@ -1,11 +1,9 @@
|
|||
// 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);
|
||||
$MyDatabaseManager get managers => $MyDatabaseManager(this);
|
||||
late final i1.$CategoriesTable categories = i1.$CategoriesTable(this);
|
||||
late final i1.$TodoItemsTable todoItems = i1.$TodoItemsTable(this);
|
||||
i0.Selectable<CategoriesWithCountResult> categoriesWithCount() {
|
||||
|
@ -30,226 +28,6 @@ abstract class $MyDatabase extends i0.GeneratedDatabase {
|
|||
[categories, todoItems];
|
||||
}
|
||||
|
||||
class $$CategoriesTableFilterComposer
|
||||
extends i0.FilterComposer<i0.GeneratedDatabase, i1.$CategoriesTable> {
|
||||
$$CategoriesTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> get id => i0.ColumnFilters($table.id);
|
||||
i0.ColumnFilters<String> 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<i1.$TodoItemsTable>('todo_items'),
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.category,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$TodoItemsTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$CategoriesTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i1.$CategoriesTable> {
|
||||
$$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<int> id,
|
||||
required String name,
|
||||
});
|
||||
typedef $$CategoriesTableUpdateCompanionBuilder = i1.CategoriesCompanion
|
||||
Function({
|
||||
i0.Value<int> id,
|
||||
i0.Value<String> 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<int> id = const i0.Value.absent(),
|
||||
i0.Value<String> name = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.CategoriesCompanion(
|
||||
id: id,
|
||||
name: name,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> id = const i0.Value.absent(),
|
||||
required String name,
|
||||
}) =>
|
||||
i1.CategoriesCompanion.insert(
|
||||
id: id,
|
||||
name: name,
|
||||
)));
|
||||
}
|
||||
|
||||
class $$TodoItemsTableFilterComposer
|
||||
extends i0.FilterComposer<i0.GeneratedDatabase, i1.$TodoItemsTable> {
|
||||
$$TodoItemsTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> get id => i0.ColumnFilters($table.id);
|
||||
i0.ColumnFilters<String> get title => i0.ColumnFilters($table.title);
|
||||
i0.ColumnFilters<String> get content => i0.ColumnFilters($table.content);
|
||||
i0.ColumnFilters<int> 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<i1.$CategoriesTable>('categories'),
|
||||
getCurrentColumn: (f) => f.category,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$CategoriesTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
|
||||
i0.ColumnFilters<DateTime> get dueDate => i0.ColumnFilters($table.dueDate);
|
||||
}
|
||||
|
||||
class $$TodoItemsTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i1.$TodoItemsTable> {
|
||||
$$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<i1.$CategoriesTable>('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<int> id,
|
||||
required String title,
|
||||
required String content,
|
||||
i0.Value<int?> category,
|
||||
i0.Value<DateTime?> dueDate,
|
||||
});
|
||||
typedef $$TodoItemsTableUpdateCompanionBuilder = i1.TodoItemsCompanion
|
||||
Function({
|
||||
i0.Value<int> id,
|
||||
i0.Value<String> title,
|
||||
i0.Value<String> content,
|
||||
i0.Value<int?> category,
|
||||
i0.Value<DateTime?> 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<int> id = const i0.Value.absent(),
|
||||
i0.Value<String> title = const i0.Value.absent(),
|
||||
i0.Value<String> content = const i0.Value.absent(),
|
||||
i0.Value<int?> category = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> dueDate = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.TodoItemsCompanion(
|
||||
id: id,
|
||||
title: title,
|
||||
content: content,
|
||||
category: category,
|
||||
dueDate: dueDate,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> id = const i0.Value.absent(),
|
||||
required String title,
|
||||
required String content,
|
||||
i0.Value<int?> category = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> 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);
|
||||
}
|
||||
|
||||
class CategoriesWithCountResult {
|
||||
final int id;
|
||||
final String name;
|
||||
|
|
|
@ -7,7 +7,6 @@ import 'package:drift_docs/snippets/modular/many_to_many/json.dart' as i3;
|
|||
|
||||
abstract class $JsonBasedDatabase extends i0.GeneratedDatabase {
|
||||
$JsonBasedDatabase(i0.QueryExecutor e) : super(e);
|
||||
$JsonBasedDatabaseManager get managers => $JsonBasedDatabaseManager(this);
|
||||
late final i1.$BuyableItemsTable buyableItems = i1.$BuyableItemsTable(this);
|
||||
late final i2.$ShoppingCartsTable shoppingCarts =
|
||||
i2.$ShoppingCartsTable(this);
|
||||
|
@ -19,174 +18,6 @@ abstract class $JsonBasedDatabase extends i0.GeneratedDatabase {
|
|||
[buyableItems, shoppingCarts];
|
||||
}
|
||||
|
||||
class $$BuyableItemsTableFilterComposer
|
||||
extends i0.FilterComposer<i0.GeneratedDatabase, i1.$BuyableItemsTable> {
|
||||
$$BuyableItemsTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> get id => i0.ColumnFilters($table.id);
|
||||
i0.ColumnFilters<String> get description =>
|
||||
i0.ColumnFilters($table.description);
|
||||
i0.ColumnFilters<int> get price => i0.ColumnFilters($table.price);
|
||||
}
|
||||
|
||||
class $$BuyableItemsTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i1.$BuyableItemsTable> {
|
||||
$$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<int> id,
|
||||
required String description,
|
||||
required int price,
|
||||
});
|
||||
typedef $$BuyableItemsTableUpdateCompanionBuilder = i1.BuyableItemsCompanion
|
||||
Function({
|
||||
i0.Value<int> id,
|
||||
i0.Value<String> description,
|
||||
i0.Value<int> 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<int> id = const i0.Value.absent(),
|
||||
i0.Value<String> description = const i0.Value.absent(),
|
||||
i0.Value<int> price = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.BuyableItemsCompanion(
|
||||
id: id,
|
||||
description: description,
|
||||
price: price,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> 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<i0.GeneratedDatabase, i2.$ShoppingCartsTable> {
|
||||
$$ShoppingCartsTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> get id => i0.ColumnFilters($table.id);
|
||||
i0.ColumnFilters<String> get entriesValue => i0.ColumnFilters($table.entries);
|
||||
i0.ColumnWithTypeConverterFilters<i3.ShoppingCartEntries, String>
|
||||
get entries => i0.ColumnWithTypeConverterFilters($table.entries);
|
||||
}
|
||||
|
||||
class $$ShoppingCartsTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i2.$ShoppingCartsTable> {
|
||||
$$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<int> id,
|
||||
required i3.ShoppingCartEntries entries,
|
||||
});
|
||||
typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion
|
||||
Function({
|
||||
i0.Value<int> id,
|
||||
i0.Value<i3.ShoppingCartEntries> 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<int> id = const i0.Value.absent(),
|
||||
i0.Value<i3.ShoppingCartEntries> entries =
|
||||
const i0.Value.absent(),
|
||||
}) =>
|
||||
i2.ShoppingCartsCompanion(
|
||||
id: id,
|
||||
entries: entries,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> 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);
|
||||
}
|
||||
|
||||
class $ShoppingCartsTable extends i3.ShoppingCarts
|
||||
with i0.TableInfo<$ShoppingCartsTable, i2.ShoppingCart> {
|
||||
@override
|
||||
|
|
|
@ -4,12 +4,10 @@ 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;
|
||||
|
||||
abstract class $RelationalDatabase extends i0.GeneratedDatabase {
|
||||
$RelationalDatabase(i0.QueryExecutor e) : super(e);
|
||||
$RelationalDatabaseManager get managers => $RelationalDatabaseManager(this);
|
||||
late final i1.$BuyableItemsTable buyableItems = i1.$BuyableItemsTable(this);
|
||||
late final i2.$ShoppingCartsTable shoppingCarts =
|
||||
i2.$ShoppingCartsTable(this);
|
||||
|
@ -23,327 +21,7 @@ abstract class $RelationalDatabase extends i0.GeneratedDatabase {
|
|||
[buyableItems, shoppingCarts, shoppingCartEntries];
|
||||
}
|
||||
|
||||
class $$BuyableItemsTableFilterComposer
|
||||
extends i0.FilterComposer<i0.GeneratedDatabase, i1.$BuyableItemsTable> {
|
||||
$$BuyableItemsTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> get id => i0.ColumnFilters($table.id);
|
||||
i0.ColumnFilters<String> get description =>
|
||||
i0.ColumnFilters($table.description);
|
||||
i0.ColumnFilters<int> 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<i2.$ShoppingCartEntriesTable>('shopping_cart_entries'),
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.item,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$ShoppingCartEntriesTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$BuyableItemsTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i1.$BuyableItemsTable> {
|
||||
$$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<int> id,
|
||||
required String description,
|
||||
required int price,
|
||||
});
|
||||
typedef $$BuyableItemsTableUpdateCompanionBuilder = i1.BuyableItemsCompanion
|
||||
Function({
|
||||
i0.Value<int> id,
|
||||
i0.Value<String> description,
|
||||
i0.Value<int> 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<int> id = const i0.Value.absent(),
|
||||
i0.Value<String> description = const i0.Value.absent(),
|
||||
i0.Value<int> price = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.BuyableItemsCompanion(
|
||||
id: id,
|
||||
description: description,
|
||||
price: price,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> 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<i0.GeneratedDatabase, i2.$ShoppingCartsTable> {
|
||||
$$ShoppingCartsTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> 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<i2.$ShoppingCartEntriesTable>('shopping_cart_entries'),
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.shoppingCart,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$ShoppingCartEntriesTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$ShoppingCartsTableOrderingComposer
|
||||
extends i0.OrderingComposer<i0.GeneratedDatabase, i2.$ShoppingCartsTable> {
|
||||
$$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<int> id,
|
||||
});
|
||||
typedef $$ShoppingCartsTableUpdateCompanionBuilder = i2.ShoppingCartsCompanion
|
||||
Function({
|
||||
i0.Value<int> 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<int> id = const i0.Value.absent(),
|
||||
}) =>
|
||||
i2.ShoppingCartsCompanion(
|
||||
id: id,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
i0.Value<int> id = const i0.Value.absent(),
|
||||
}) =>
|
||||
i2.ShoppingCartsCompanion.insert(
|
||||
id: id,
|
||||
)));
|
||||
}
|
||||
|
||||
class $$ShoppingCartEntriesTableFilterComposer extends i0
|
||||
.FilterComposer<i0.GeneratedDatabase, i2.$ShoppingCartEntriesTable> {
|
||||
$$ShoppingCartEntriesTableFilterComposer(super.db, super.table);
|
||||
i0.ColumnFilters<int> 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<i2.$ShoppingCartsTable>('shopping_carts'),
|
||||
getCurrentColumn: (f) => f.shoppingCart,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$ShoppingCartsTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
|
||||
i0.ColumnFilters<int> 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<i1.$BuyableItemsTable>('buyable_items'),
|
||||
getCurrentColumn: (f) => f.item,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$BuyableItemsTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$ShoppingCartEntriesTableOrderingComposer extends i0
|
||||
.OrderingComposer<i0.GeneratedDatabase, i2.$ShoppingCartEntriesTable> {
|
||||
$$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<i2.$ShoppingCartsTable>('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<i1.$BuyableItemsTable>('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,
|
||||
});
|
||||
typedef $$ShoppingCartEntriesTableUpdateCompanionBuilder
|
||||
= i2.ShoppingCartEntriesCompanion Function({
|
||||
i0.Value<int> shoppingCart,
|
||||
i0.Value<int> item,
|
||||
});
|
||||
|
||||
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<int> shoppingCart = const i0.Value.absent(),
|
||||
i0.Value<int> item = const i0.Value.absent(),
|
||||
}) =>
|
||||
i2.ShoppingCartEntriesCompanion(
|
||||
shoppingCart: shoppingCart,
|
||||
item: item,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required int shoppingCart,
|
||||
required int item,
|
||||
}) =>
|
||||
i2.ShoppingCartEntriesCompanion.insert(
|
||||
shoppingCart: shoppingCart,
|
||||
item: item,
|
||||
)));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
class $ShoppingCartsTable extends i4.ShoppingCarts
|
||||
class $ShoppingCartsTable extends i3.ShoppingCarts
|
||||
with i0.TableInfo<$ShoppingCartsTable, i2.ShoppingCart> {
|
||||
@override
|
||||
final i0.GeneratedDatabase attachedDatabase;
|
||||
|
@ -485,7 +163,7 @@ class ShoppingCartsCompanion extends i0.UpdateCompanion<i2.ShoppingCart> {
|
|||
}
|
||||
}
|
||||
|
||||
class $ShoppingCartEntriesTable extends i4.ShoppingCartEntries
|
||||
class $ShoppingCartEntriesTable extends i3.ShoppingCartEntries
|
||||
with i0.TableInfo<$ShoppingCartEntriesTable, i2.ShoppingCartEntry> {
|
||||
@override
|
||||
final i0.GeneratedDatabase attachedDatabase;
|
||||
|
|
|
@ -685,6 +685,7 @@ class $TodoItemWithCategoryNameViewView extends ViewInfo<
|
|||
|
||||
abstract class _$Database extends GeneratedDatabase {
|
||||
_$Database(QueryExecutor e) : super(e);
|
||||
_$DatabaseManager get managers => _$DatabaseManager(this);
|
||||
late final $TodoCategoriesTable todoCategories = $TodoCategoriesTable(this);
|
||||
late final $TodoItemsTable todoItems = $TodoItemsTable(this);
|
||||
late final $TodoCategoryItemCountView todoCategoryItemCount =
|
||||
|
@ -705,3 +706,211 @@ abstract class _$Database extends GeneratedDatabase {
|
|||
itemTitle
|
||||
];
|
||||
}
|
||||
|
||||
class $$TodoCategoriesTableFilterComposer
|
||||
extends FilterComposer<_$Database, $TodoCategoriesTable> {
|
||||
$$TodoCategoriesTableFilterComposer(super.db, super.table);
|
||||
ColumnFilters<int> get id => ColumnFilters($table.id);
|
||||
ColumnFilters<String> get name => ColumnFilters($table.name);
|
||||
ComposableFilter todoItemsRefs(
|
||||
ComposableFilter Function($$TodoItemsTableFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.todoItems,
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.categoryId,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$TodoItemsTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$TodoCategoriesTableOrderingComposer
|
||||
extends OrderingComposer<_$Database, $TodoCategoriesTable> {
|
||||
$$TodoCategoriesTableOrderingComposer(super.db, super.table);
|
||||
ColumnOrderings get id => ColumnOrderings($table.id);
|
||||
ColumnOrderings get name => ColumnOrderings($table.name);
|
||||
}
|
||||
|
||||
class $$TodoCategoriesTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$Database,
|
||||
$TodoCategoriesTable,
|
||||
TodoCategory,
|
||||
$$TodoCategoriesTableFilterComposer,
|
||||
$$TodoCategoriesTableOrderingComposer,
|
||||
$$TodoCategoriesTableProcessedTableManager,
|
||||
$$TodoCategoriesTableInsertCompanionBuilder,
|
||||
$$TodoCategoriesTableUpdateCompanionBuilder> {
|
||||
const $$TodoCategoriesTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
typedef $$TodoCategoriesTableInsertCompanionBuilder = TodoCategoriesCompanion
|
||||
Function({
|
||||
Value<int> id,
|
||||
required String name,
|
||||
});
|
||||
typedef $$TodoCategoriesTableUpdateCompanionBuilder = TodoCategoriesCompanion
|
||||
Function({
|
||||
Value<int> id,
|
||||
Value<String> name,
|
||||
});
|
||||
|
||||
class $$TodoCategoriesTableTableManager extends RootTableManager<
|
||||
_$Database,
|
||||
$TodoCategoriesTable,
|
||||
TodoCategory,
|
||||
$$TodoCategoriesTableFilterComposer,
|
||||
$$TodoCategoriesTableOrderingComposer,
|
||||
$$TodoCategoriesTableProcessedTableManager,
|
||||
$$TodoCategoriesTableInsertCompanionBuilder,
|
||||
$$TodoCategoriesTableUpdateCompanionBuilder> {
|
||||
$$TodoCategoriesTableTableManager(_$Database db, $TodoCategoriesTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$TodoCategoriesTableFilterComposer(db, table),
|
||||
orderingComposer: $$TodoCategoriesTableOrderingComposer(db, table),
|
||||
getChildManagerBuilder: (p0) =>
|
||||
$$TodoCategoriesTableProcessedTableManager(p0),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> name = const Value.absent(),
|
||||
}) =>
|
||||
TodoCategoriesCompanion(
|
||||
id: id,
|
||||
name: name,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
required String name,
|
||||
}) =>
|
||||
TodoCategoriesCompanion.insert(
|
||||
id: id,
|
||||
name: name,
|
||||
)));
|
||||
}
|
||||
|
||||
class $$TodoItemsTableFilterComposer
|
||||
extends FilterComposer<_$Database, $TodoItemsTable> {
|
||||
$$TodoItemsTableFilterComposer(super.db, super.table);
|
||||
ColumnFilters<int> get id => ColumnFilters($table.id);
|
||||
ColumnFilters<String> get title => ColumnFilters($table.title);
|
||||
ColumnFilters<String> get content => ColumnFilters($table.content);
|
||||
ColumnFilters<int> get categoryIdId => ColumnFilters($table.categoryId);
|
||||
ComposableFilter categoryId(
|
||||
ComposableFilter Function($$TodoCategoriesTableFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.todoCategories,
|
||||
getCurrentColumn: (f) => f.categoryId,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$TodoCategoriesTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
|
||||
ColumnFilters<String> get generatedText =>
|
||||
ColumnFilters($table.generatedText);
|
||||
}
|
||||
|
||||
class $$TodoItemsTableOrderingComposer
|
||||
extends OrderingComposer<_$Database, $TodoItemsTable> {
|
||||
$$TodoItemsTableOrderingComposer(super.db, super.table);
|
||||
ColumnOrderings get id => ColumnOrderings($table.id);
|
||||
ColumnOrderings get title => ColumnOrderings($table.title);
|
||||
ColumnOrderings get content => ColumnOrderings($table.content);
|
||||
ColumnOrderings get categoryIdId => ColumnOrderings($table.categoryId);
|
||||
ComposableOrdering categoryId(
|
||||
ComposableOrdering Function($$TodoCategoriesTableOrderingComposer o) o) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.todoCategories,
|
||||
getCurrentColumn: (f) => f.categoryId,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$TodoCategoriesTableOrderingComposer(db, table),
|
||||
builder: o);
|
||||
}
|
||||
|
||||
ColumnOrderings get generatedText => ColumnOrderings($table.generatedText);
|
||||
}
|
||||
|
||||
class $$TodoItemsTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$Database,
|
||||
$TodoItemsTable,
|
||||
TodoItem,
|
||||
$$TodoItemsTableFilterComposer,
|
||||
$$TodoItemsTableOrderingComposer,
|
||||
$$TodoItemsTableProcessedTableManager,
|
||||
$$TodoItemsTableInsertCompanionBuilder,
|
||||
$$TodoItemsTableUpdateCompanionBuilder> {
|
||||
const $$TodoItemsTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
typedef $$TodoItemsTableInsertCompanionBuilder = TodoItemsCompanion Function({
|
||||
Value<int> id,
|
||||
required String title,
|
||||
Value<String?> content,
|
||||
required int categoryId,
|
||||
});
|
||||
typedef $$TodoItemsTableUpdateCompanionBuilder = TodoItemsCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> title,
|
||||
Value<String?> content,
|
||||
Value<int> categoryId,
|
||||
});
|
||||
|
||||
class $$TodoItemsTableTableManager extends RootTableManager<
|
||||
_$Database,
|
||||
$TodoItemsTable,
|
||||
TodoItem,
|
||||
$$TodoItemsTableFilterComposer,
|
||||
$$TodoItemsTableOrderingComposer,
|
||||
$$TodoItemsTableProcessedTableManager,
|
||||
$$TodoItemsTableInsertCompanionBuilder,
|
||||
$$TodoItemsTableUpdateCompanionBuilder> {
|
||||
$$TodoItemsTableTableManager(_$Database db, $TodoItemsTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$TodoItemsTableFilterComposer(db, table),
|
||||
orderingComposer: $$TodoItemsTableOrderingComposer(db, table),
|
||||
getChildManagerBuilder: (p0) =>
|
||||
$$TodoItemsTableProcessedTableManager(p0),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> title = const Value.absent(),
|
||||
Value<String?> content = const Value.absent(),
|
||||
Value<int> categoryId = const Value.absent(),
|
||||
}) =>
|
||||
TodoItemsCompanion(
|
||||
id: id,
|
||||
title: title,
|
||||
content: content,
|
||||
categoryId: categoryId,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
required String title,
|
||||
Value<String?> content = const Value.absent(),
|
||||
required int categoryId,
|
||||
}) =>
|
||||
TodoItemsCompanion.insert(
|
||||
id: id,
|
||||
title: title,
|
||||
content: content,
|
||||
categoryId: categoryId,
|
||||
)));
|
||||
}
|
||||
|
||||
class _$DatabaseManager {
|
||||
final _$Database _db;
|
||||
_$DatabaseManager(this._db);
|
||||
$$TodoCategoriesTableTableManager get todoCategories =>
|
||||
$$TodoCategoriesTableTableManager(_db, _db.todoCategories);
|
||||
$$TodoItemsTableTableManager get todoItems =>
|
||||
$$TodoItemsTableTableManager(_db, _db.todoItems);
|
||||
}
|
||||
|
|
|
@ -40,3 +40,6 @@ dev_dependencies:
|
|||
shelf: ^1.3.0
|
||||
test_descriptor: ^2.0.1
|
||||
vm_service: ^13.0.0
|
||||
dependency_overrides:
|
||||
drift_dev:
|
||||
path: ../drift_dev
|
|
@ -0,0 +1,54 @@
|
|||
import 'package:drift/drift.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../generated/todos.dart';
|
||||
import '../test_utils/matchers.dart';
|
||||
import '../test_utils/mocks.dart';
|
||||
|
||||
void main() {
|
||||
driftRuntimeOptions.dontWarnAboutMultipleDatabases = true;
|
||||
|
||||
late TodoDb db;
|
||||
late MockExecutor executor;
|
||||
|
||||
setUp(() {
|
||||
executor = MockExecutor();
|
||||
db = TodoDb(executor);
|
||||
});
|
||||
|
||||
test('manager - generates parentheses for OR in AND', () {
|
||||
final filterComposer = $$CategoriesTableFilterComposer(db, db.categories);
|
||||
final expr = (filterComposer.idValue(1) | filterComposer.idValue(2)) &
|
||||
(filterComposer.idValue(3) | filterComposer.idValue(4));
|
||||
expect(
|
||||
expr.expression,
|
||||
generates(
|
||||
'("id" = ? OR "id" = ?) AND ("id" = ? OR "id" = ?)', [1, 2, 3, 4]));
|
||||
});
|
||||
|
||||
test('manager - equals', () {
|
||||
final filterComposer = $$CategoriesTableFilterComposer(db, db.categories);
|
||||
// Numeric
|
||||
expect(filterComposer.idValue.equals(3).expression,
|
||||
generates('"id" = ?', [3]));
|
||||
expect(filterComposer.idValue(3).expression, generates('"id" = ?', [3]));
|
||||
expect(
|
||||
filterComposer.idValue.isNull().expression, generates('"id" IS NULL'));
|
||||
// Text
|
||||
expect(filterComposer.description.equals("Hi").expression,
|
||||
generates('"desc" = ?', ["Hi"]));
|
||||
expect(filterComposer.description("Hi").expression,
|
||||
generates('"desc" = ?', ["Hi"]));
|
||||
expect(filterComposer.description.isNull().expression,
|
||||
generates('"desc" IS NULL'));
|
||||
});
|
||||
|
||||
// test('manager - combine query with AND ', () {
|
||||
// e.expression.hashCode;
|
||||
|
||||
// expect(
|
||||
// countAll(filter: e.expression),
|
||||
// generates('WHERE "id" = FILTER (WHERE foo >= ?)', [1, 2]),
|
||||
// );
|
||||
// });
|
||||
}
|
|
@ -615,7 +615,7 @@ class ManagerWriter {
|
|||
}
|
||||
|
||||
// Remove ones that have custom row classes
|
||||
tableWriters.removeWhere((t) => !t.hasCustomRowClass);
|
||||
tableWriters.removeWhere((t) => t.hasCustomRowClass);
|
||||
|
||||
// Write each tables manager to the leaf and append the getter to the main manager
|
||||
final tableManagerGetters = StringBuffer();
|
||||
|
|
|
@ -59,7 +59,8 @@ class ProductPage extends HookConsumerWidget {
|
|||
),
|
||||
TextField(
|
||||
controller: descriptionTextController,
|
||||
decoration: const InputDecoration(labelText: "Description"),
|
||||
decoration:
|
||||
const InputDecoration(labelText: "Description"),
|
||||
),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
|
|
|
@ -33,3 +33,9 @@ dev_dependencies:
|
|||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
dependency_overrides:
|
||||
drift_dev:
|
||||
path: ../../drift_dev
|
||||
drift:
|
||||
path: ../../drift
|
|
@ -884,7 +884,6 @@ class GroupCount extends ViewInfo<GroupCount, GroupCountData>
|
|||
|
||||
abstract class _$Database extends GeneratedDatabase {
|
||||
_$Database(QueryExecutor e) : super(e);
|
||||
_$DatabaseManager get managers => _$DatabaseManager(this);
|
||||
late final $UsersTable users = $UsersTable(this);
|
||||
late final Groups groups = Groups(this);
|
||||
late final Notes notes = Notes(this);
|
||||
|
@ -901,329 +900,3 @@ abstract class _$Database extends GeneratedDatabase {
|
|||
DriftDatabaseOptions get options =>
|
||||
const DriftDatabaseOptions(storeDateTimeAsText: true);
|
||||
}
|
||||
|
||||
class $$UsersTableFilterComposer
|
||||
extends FilterComposer<_$Database, $UsersTable> {
|
||||
$$UsersTableFilterComposer(super.db, super.table);
|
||||
ColumnFilters<int> get id => ColumnFilters($table.id);
|
||||
ColumnFilters<String> get name => ColumnFilters($table.name);
|
||||
ColumnFilters<DateTime> get birthday => ColumnFilters($table.birthday);
|
||||
ColumnFilters<int> get nextUserId => ColumnFilters($table.nextUser);
|
||||
ComposableFilter nextUser(
|
||||
ComposableFilter Function($$UsersTableFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.users,
|
||||
getCurrentColumn: (f) => f.nextUser,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$UsersTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
|
||||
ComposableFilter usersRefs(
|
||||
ComposableFilter Function($$UsersTableFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.users,
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.nextUser,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$UsersTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
|
||||
ComposableFilter groupsRefs(
|
||||
ComposableFilter Function($GroupsFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.groups,
|
||||
getCurrentColumn: (f) => f.id,
|
||||
getReferencedColumn: (f) => f.owner,
|
||||
getReferencedComposer: (db, table) => $GroupsFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $$UsersTableOrderingComposer
|
||||
extends OrderingComposer<_$Database, $UsersTable> {
|
||||
$$UsersTableOrderingComposer(super.db, super.table);
|
||||
ColumnOrderings get id => ColumnOrderings($table.id);
|
||||
ColumnOrderings get name => ColumnOrderings($table.name);
|
||||
ColumnOrderings get birthday => ColumnOrderings($table.birthday);
|
||||
ColumnOrderings get nextUserId => ColumnOrderings($table.nextUser);
|
||||
ComposableOrdering nextUser(
|
||||
ComposableOrdering Function($$UsersTableOrderingComposer o) o) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.users,
|
||||
getCurrentColumn: (f) => f.nextUser,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$UsersTableOrderingComposer(db, table),
|
||||
builder: o);
|
||||
}
|
||||
}
|
||||
|
||||
class $$UsersTableProcessedTableManager extends ProcessedTableManager<
|
||||
_$Database,
|
||||
$UsersTable,
|
||||
User,
|
||||
$$UsersTableFilterComposer,
|
||||
$$UsersTableOrderingComposer,
|
||||
$$UsersTableProcessedTableManager,
|
||||
$$UsersTableInsertCompanionBuilder,
|
||||
$$UsersTableUpdateCompanionBuilder> {
|
||||
const $$UsersTableProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
typedef $$UsersTableInsertCompanionBuilder = UsersCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> name,
|
||||
Value<DateTime?> birthday,
|
||||
Value<int?> nextUser,
|
||||
});
|
||||
typedef $$UsersTableUpdateCompanionBuilder = UsersCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> name,
|
||||
Value<DateTime?> birthday,
|
||||
Value<int?> nextUser,
|
||||
});
|
||||
|
||||
class $$UsersTableTableManager extends RootTableManager<
|
||||
_$Database,
|
||||
$UsersTable,
|
||||
User,
|
||||
$$UsersTableFilterComposer,
|
||||
$$UsersTableOrderingComposer,
|
||||
$$UsersTableProcessedTableManager,
|
||||
$$UsersTableInsertCompanionBuilder,
|
||||
$$UsersTableUpdateCompanionBuilder> {
|
||||
$$UsersTableTableManager(_$Database db, $UsersTable table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $$UsersTableFilterComposer(db, table),
|
||||
orderingComposer: $$UsersTableOrderingComposer(db, table),
|
||||
getChildManagerBuilder: (p0) =>
|
||||
$$UsersTableProcessedTableManager(p0),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> name = const Value.absent(),
|
||||
Value<DateTime?> birthday = const Value.absent(),
|
||||
Value<int?> nextUser = const Value.absent(),
|
||||
}) =>
|
||||
UsersCompanion(
|
||||
id: id,
|
||||
name: name,
|
||||
birthday: birthday,
|
||||
nextUser: nextUser,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> name = const Value.absent(),
|
||||
Value<DateTime?> birthday = const Value.absent(),
|
||||
Value<int?> nextUser = const Value.absent(),
|
||||
}) =>
|
||||
UsersCompanion.insert(
|
||||
id: id,
|
||||
name: name,
|
||||
birthday: birthday,
|
||||
nextUser: nextUser,
|
||||
)));
|
||||
}
|
||||
|
||||
class $GroupsFilterComposer extends FilterComposer<_$Database, Groups> {
|
||||
$GroupsFilterComposer(super.db, super.table);
|
||||
ColumnFilters<int> get id => ColumnFilters($table.id);
|
||||
ColumnFilters<String> get title => ColumnFilters($table.title);
|
||||
ColumnFilters<bool> get deleted => ColumnFilters($table.deleted);
|
||||
ColumnFilters<int> get ownerId => ColumnFilters($table.owner);
|
||||
ComposableFilter owner(
|
||||
ComposableFilter Function($$UsersTableFilterComposer f) f) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.users,
|
||||
getCurrentColumn: (f) => f.owner,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$UsersTableFilterComposer(db, table),
|
||||
builder: f);
|
||||
}
|
||||
}
|
||||
|
||||
class $GroupsOrderingComposer extends OrderingComposer<_$Database, Groups> {
|
||||
$GroupsOrderingComposer(super.db, super.table);
|
||||
ColumnOrderings get id => ColumnOrderings($table.id);
|
||||
ColumnOrderings get title => ColumnOrderings($table.title);
|
||||
ColumnOrderings get deleted => ColumnOrderings($table.deleted);
|
||||
ColumnOrderings get ownerId => ColumnOrderings($table.owner);
|
||||
ComposableOrdering owner(
|
||||
ComposableOrdering Function($$UsersTableOrderingComposer o) o) {
|
||||
return $composeWithJoins(
|
||||
$db: $db,
|
||||
$table: $table,
|
||||
referencedTable: $db.users,
|
||||
getCurrentColumn: (f) => f.owner,
|
||||
getReferencedColumn: (f) => f.id,
|
||||
getReferencedComposer: (db, table) =>
|
||||
$$UsersTableOrderingComposer(db, table),
|
||||
builder: o);
|
||||
}
|
||||
}
|
||||
|
||||
class $GroupsProcessedTableManager extends ProcessedTableManager<
|
||||
_$Database,
|
||||
Groups,
|
||||
Group,
|
||||
$GroupsFilterComposer,
|
||||
$GroupsOrderingComposer,
|
||||
$GroupsProcessedTableManager,
|
||||
$GroupsInsertCompanionBuilder,
|
||||
$GroupsUpdateCompanionBuilder> {
|
||||
const $GroupsProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
typedef $GroupsInsertCompanionBuilder = GroupsCompanion Function({
|
||||
Value<int> id,
|
||||
required String title,
|
||||
Value<bool?> deleted,
|
||||
required int owner,
|
||||
});
|
||||
typedef $GroupsUpdateCompanionBuilder = GroupsCompanion Function({
|
||||
Value<int> id,
|
||||
Value<String> title,
|
||||
Value<bool?> deleted,
|
||||
Value<int> owner,
|
||||
});
|
||||
|
||||
class $GroupsTableManager extends RootTableManager<
|
||||
_$Database,
|
||||
Groups,
|
||||
Group,
|
||||
$GroupsFilterComposer,
|
||||
$GroupsOrderingComposer,
|
||||
$GroupsProcessedTableManager,
|
||||
$GroupsInsertCompanionBuilder,
|
||||
$GroupsUpdateCompanionBuilder> {
|
||||
$GroupsTableManager(_$Database db, Groups table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $GroupsFilterComposer(db, table),
|
||||
orderingComposer: $GroupsOrderingComposer(db, table),
|
||||
getChildManagerBuilder: (p0) => $GroupsProcessedTableManager(p0),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
Value<String> title = const Value.absent(),
|
||||
Value<bool?> deleted = const Value.absent(),
|
||||
Value<int> owner = const Value.absent(),
|
||||
}) =>
|
||||
GroupsCompanion(
|
||||
id: id,
|
||||
title: title,
|
||||
deleted: deleted,
|
||||
owner: owner,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
Value<int> id = const Value.absent(),
|
||||
required String title,
|
||||
Value<bool?> deleted = const Value.absent(),
|
||||
required int owner,
|
||||
}) =>
|
||||
GroupsCompanion.insert(
|
||||
id: id,
|
||||
title: title,
|
||||
deleted: deleted,
|
||||
owner: owner,
|
||||
)));
|
||||
}
|
||||
|
||||
class $NotesFilterComposer extends FilterComposer<_$Database, Notes> {
|
||||
$NotesFilterComposer(super.db, super.table);
|
||||
ColumnFilters<String> get title => ColumnFilters($table.title);
|
||||
ColumnFilters<String> get content => ColumnFilters($table.content);
|
||||
ColumnFilters<String> get searchTerms => ColumnFilters($table.searchTerms);
|
||||
}
|
||||
|
||||
class $NotesOrderingComposer extends OrderingComposer<_$Database, Notes> {
|
||||
$NotesOrderingComposer(super.db, super.table);
|
||||
ColumnOrderings get title => ColumnOrderings($table.title);
|
||||
ColumnOrderings get content => ColumnOrderings($table.content);
|
||||
ColumnOrderings get searchTerms => ColumnOrderings($table.searchTerms);
|
||||
}
|
||||
|
||||
class $NotesProcessedTableManager extends ProcessedTableManager<
|
||||
_$Database,
|
||||
Notes,
|
||||
Note,
|
||||
$NotesFilterComposer,
|
||||
$NotesOrderingComposer,
|
||||
$NotesProcessedTableManager,
|
||||
$NotesInsertCompanionBuilder,
|
||||
$NotesUpdateCompanionBuilder> {
|
||||
const $NotesProcessedTableManager(super.$state);
|
||||
}
|
||||
|
||||
typedef $NotesInsertCompanionBuilder = NotesCompanion Function({
|
||||
required String title,
|
||||
required String content,
|
||||
required String searchTerms,
|
||||
});
|
||||
typedef $NotesUpdateCompanionBuilder = NotesCompanion Function({
|
||||
Value<String> title,
|
||||
Value<String> content,
|
||||
Value<String> searchTerms,
|
||||
});
|
||||
|
||||
class $NotesTableManager extends RootTableManager<
|
||||
_$Database,
|
||||
Notes,
|
||||
Note,
|
||||
$NotesFilterComposer,
|
||||
$NotesOrderingComposer,
|
||||
$NotesProcessedTableManager,
|
||||
$NotesInsertCompanionBuilder,
|
||||
$NotesUpdateCompanionBuilder> {
|
||||
$NotesTableManager(_$Database db, Notes table)
|
||||
: super(TableManagerState(
|
||||
db: db,
|
||||
table: table,
|
||||
filteringComposer: $NotesFilterComposer(db, table),
|
||||
orderingComposer: $NotesOrderingComposer(db, table),
|
||||
getChildManagerBuilder: (p0) => $NotesProcessedTableManager(p0),
|
||||
getUpdateCompanionBuilder: ({
|
||||
Value<String> title = const Value.absent(),
|
||||
Value<String> content = const Value.absent(),
|
||||
Value<String> searchTerms = const Value.absent(),
|
||||
}) =>
|
||||
NotesCompanion(
|
||||
title: title,
|
||||
content: content,
|
||||
searchTerms: searchTerms,
|
||||
),
|
||||
getInsertCompanionBuilder: ({
|
||||
required String title,
|
||||
required String content,
|
||||
required String searchTerms,
|
||||
}) =>
|
||||
NotesCompanion.insert(
|
||||
title: title,
|
||||
content: content,
|
||||
searchTerms: searchTerms,
|
||||
)));
|
||||
}
|
||||
|
||||
class _$DatabaseManager {
|
||||
final _$Database _db;
|
||||
_$DatabaseManager(this._db);
|
||||
$$UsersTableTableManager get users =>
|
||||
$$UsersTableTableManager(_db, _db.users);
|
||||
$GroupsTableManager get groups => $GroupsTableManager(_db, _db.groups);
|
||||
$NotesTableManager get notes => $NotesTableManager(_db, _db.notes);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ Future<void> main() async {
|
|||
|
||||
output.writeAsStringSync(json.encode(tracker.timings));
|
||||
|
||||
// Make sure the process exits. Otherwise, unclosed resources from the
|
||||
// Make sure the process exits. Otherwise, unclosed resources from the
|
||||
// benchmarks will keep the process alive.
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ SELECT * FROM key_values WHERE value IN (SELECT value FROM key_values WHERE valu
|
|||
''';
|
||||
|
||||
final fs = <Future>[];
|
||||
|
||||
|
||||
for (var i = 0; i < _numQueries; i++) {
|
||||
fs.add(
|
||||
_db.customSelect(queryToBench, variables: [Variable(uuid.v4())]).get(),
|
||||
|
|
Loading…
Reference in New Issue