ModelRepository<TTable extends Table, TModel> class

Repository pattern for model operations

Provides static-like methods for querying models. This is a helper class that works with Drift's generated code.

Constructors

ModelRepository(DatabaseConnectionUser database, TableInfo<TTable, TModel> table)

Properties

database DatabaseConnectionUser
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
table TableInfo<TTable, TModel>
final

Methods

all() Future<List<TModel>>
Find all records
count() Future<int>
Count all records
find(dynamic id) Future<TModel?>
Find a record by ID
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
where(Expression<bool> filter(TTable tbl)) Future<List<TModel>>
Find records matching conditions

Operators

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