SqliteRecords class abstract interface

The core executor interface, supporting mutations and transactions.

Implemented types

Constructors

SqliteRecords.fromPowerSync(PowerSyncDatabase db)
Creates a SqliteRecords instance from a PowerSyncDatabase.
factory

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

execute<P>(Command<P> mutation, [P? params]) Future<ResultSet>
Executes a single mutation.
executeBatch<P>(Command<P> mutation, List<P> paramsList) Future<void>
Executes a mutation multiple times in a single batch operation.
get<P, R extends Record>(Query<P, R> query, [P? params]) Future<SafeRow<R>>
Fetches exactly one row. Throws if no row is found.
inherited
getAll<P, R extends Record>(Query<P, R> query, [P? params]) Future<SafeResultSet<R>>
Fetches all rows matching the query.
inherited
getOptional<P, R extends Record>(Query<P, R> query, [P? params]) Future<SafeRow<R>?>
Fetches an optional row. Returns null if not found.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readTransaction<T>(Future<T> action(SqliteRecordsReadonly tx)) Future<T>
Opens a read-only transaction.
toString() String
A string representation of this object.
inherited
watch<P, R extends Record>(Query<P, R> query, {P? params, Duration throttle = const Duration(milliseconds: 30), Iterable<String>? triggerOnTables}) Stream<SafeResultSet<R>>
Reactively watches a query for changes. NOTE: This is only supported on the main database connection, not in transactions.
writeTransaction<T>(Future<T> action(SqliteRecords tx)) Future<T>
Opens a read-write transaction.

Operators

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