PrefetchHooks class

When a user requests that certain fields are prefetched, we create a PrefetchHooks class for the manager. This class has hooks for adding joins to the query before the query is executed, and for running prefetches after the query is executed. This class is implemented by the code generator and should not be instantiated or extended manually.

Constructors

PrefetchHooks({required GeneratedDatabase db, StateTransformer? addJoins, List<TableInfo<Table, dynamic>> explicitlyWatchedTables = const [], Future<List<List<MultiTypedResultEntry>>> getPrefetchedDataCallback(List<TypedResult>)?})
Create a PrefetchHooks object

Properties

db GeneratedDatabase
The database instance
final
explicitlyWatchedTables List<TableInfo<Table, dynamic>>
Tables which should be watched explicitly by the original query.
final
getPrefetchedDataCallback Future<List<List<MultiTypedResultEntry>>> Function(List<TypedResult>)?
A function which will return list of references for each prefetch data source.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
withJoins StateTransformer
This callback is used to add joins to the query before it is executed.
latefinal

Methods

addPrefetchedData(List<TypedResult> items) Future<List<TypedResult>>
Internal function for injecting the prefetched data into the TypedResult object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited