$$BookTableTableManager constructor
$$BookTableTableManager(
- _$SharedDatabase db,
- $BookTable table
Implementation
$$BookTableTableManager(_$SharedDatabase db, $BookTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$BookTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$BookTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$BookTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> code = const Value.absent(),
Value<String> title = const Value.absent(),
Value<int> seqNum = const Value.absent(),
Value<bool> published = const Value.absent(),
Value<bool> locked = const Value.absent(),
Value<String?> imagePath = const Value.absent(),
Value<String?> description = const Value.absent(),
Value<String?> note = const Value.absent(),
}) => BookCompanion(
id: id,
code: code,
title: title,
seqNum: seqNum,
published: published,
locked: locked,
imagePath: imagePath,
description: description,
note: note,
),
createCompanionCallback:
({
Value<int> id = const Value.absent(),
required String code,
required String title,
required int seqNum,
required bool published,
required bool locked,
Value<String?> imagePath = const Value.absent(),
Value<String?> description = const Value.absent(),
Value<String?> note = const Value.absent(),
}) => BookCompanion.insert(
id: id,
code: code,
title: title,
seqNum: seqNum,
published: published,
locked: locked,
imagePath: imagePath,
description: description,
note: note,
),
withReferenceMapper: (p0) => p0
.map(
(e) =>
(e.readTable(table), $$BookTableReferences(db, table, e)),
)
.toList(),
prefetchHooksCallback: ({lessonRefs = false}) {
return PrefetchHooks(
db: db,
explicitlyWatchedTables: [if (lessonRefs) db.lesson],
addJoins: null,
getPrefetchedDataCallback: (items) async {
return [
if (lessonRefs)
await $_getPrefetchedData<BookData, $BookTable, LessonData>(
currentTable: table,
referencedTable: $$BookTableReferences._lessonRefsTable(
db,
),
managerFromTypedResult: (p0) =>
$$BookTableReferences(db, table, p0).lessonRefs,
referencedItemsForCurrentItem: (item, referencedItems) =>
referencedItems.where((e) => e.bookId == item.id),
typedResults: items,
),
];
},
);
},
),
);