DbTransaction class abstract

A database transaction session.

Provides the same query methods as DartApiDB without the lifecycle methods (connect, close). Passed to the callback in DartApiDB.transaction.

await db.transaction((tx) async {
  await tx.insert('orders', orderData);
  await tx.insert('order_items', itemData);
});
Implementers

Constructors

DbTransaction()

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

delete(String table, {required Map<String, dynamic> where}) Future<DbResult>
insert(String table, Map<String, dynamic> data) Future<DbResult>
insertBatch(String table, List<Map<String, dynamic>> rows) Future<DbResult>
Inserts multiple rows into table in a single batch operation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawQuery(String query, {Map<String, dynamic>? values}) Future<DbResult>
select(String table, {Map<String, dynamic>? where}) Future<DbResult>
toString() String
A string representation of this object.
inherited
update(String table, Map<String, dynamic> data, {required Map<String, dynamic> where}) Future<DbResult>

Operators

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