DatabaseOwner class final
A single connection/handle owner. Share sendPort with other isolates and connect through DatabaseClient; never open additional file handles directly.
Existing file entries must already be durable. All participating clients use the same canonical path (hard-link aliases are unsupported). A loopback port lease also prevents separate owner isolates in this process from bypassing POSIX's process-scoped file locks. Hash/port collisions fail closed as busy. No SQL/data is served over the socket; RPC uses Dart SendPorts only.
- Available extensions
Properties
Methods
-
batch(
) → Batch - Collects statements and runs them in Batch.commit.
-
close(
) → Future< void> -
delete(
String table, {String? where, List< Object?> ? whereArgs}) → Future<int> -
Deletes the rows selected by
whereand returns the changed-row count. -
execute(
String sql, [List< Object?> parameters = const []]) → Future<MutationResult> - Runs a statement that changes rows. This is DatabaseClient.execute.
-
insert(
String table, Map< String, Object?> values, {String? nullColumnHack, ConflictAlgorithm? conflictAlgorithm}) → Future<BigInt> -
Inserts
valuesand returns the new row id. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
page(
{required String table, required List< String> keyColumns, List<PageOrder> orderBy = const [], List<String> ? columns, String? where, List<Object?> parameters = const [], int size = 30, PageCursor? after, PageCursor? before, String cursorScope = ''}) → Future<SqlPage< Map< >String, Object?> > -
Available on DatabaseOwner, provided by the DatabaseOwnerPagination extension
-
query(
String table, {bool? distinct, List< String> ? columns, String? where, List<Object?> ? whereArgs, String? groupBy, String? having, String? orderBy, int? limit, int? offset}) → Future<List< Map< >String, Object?> > -
Reads
table.whereis SQL, and its values belong inwhereArgs. -
rawDelete(
String sql, [List< Object?> ? arguments]) → Future<int> - Runs one delete and returns the changed-row count.
-
rawInsert(
String sql, [List< Object?> ? arguments]) → Future<BigInt> - Runs one insert and returns its row id.
-
rawQuery(
String sql, [List< Object?> ? arguments]) → Future<List< Map< >String, Object?> > - Runs one statement and returns the rows as maps.
-
rawUpdate(
String sql, [List< Object?> ? arguments]) → Future<int> - Runs one update and returns the changed-row count.
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
T> (Future< T> action(Transaction txn)) → Future<T> -
Runs
actionin a transaction. A nested call uses a savepoint. -
update(
String table, Map< String, Object?> values, {String? where, List<Object?> ? whereArgs, ConflictAlgorithm? conflictAlgorithm}) → Future<int> -
Updates the rows selected by
whereand returns the changed-row count.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited