ComonOrmClient class
Entry point for ad-hoc access to models through a DatabaseAdapter.
Generated clients wrap this class, but it can also be used directly in tests or low-level integrations.
Constructors
-
ComonOrmClient({required DatabaseAdapter adapter, RuntimeSchemaView? schemaView, List<
DatabaseMiddleware> middlewares = const <DatabaseMiddleware>[], QueryLogWriter? logger}) -
Creates a client backed by
adapter.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
batch<
T> (List< Future< operations) → Future<T> Function(ComonOrmClient tx)>List< T> > - Runs a list of operations inside a single transaction and returns each result in order.
-
close(
) → Future< void> - Releases resources owned by the underlying adapter.
-
model(
String name) → ModelDelegate -
Returns a delegate that enforces
namefor every query issued through it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clears the state of the underlying in-memory adapter.
-
seed(
Map< String, List< data, {bool replace = false}) → voidMap< >String, Object?> > - Adds seed data to the underlying in-memory adapter.
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
T> (Future< T> action(ComonOrmClient tx)) → Future<T> -
Runs
actioninside an adapter-managed transaction.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited