Database class abstract

Abstraction over a database either available locally or in a remote worker.

Constructors

Database()

Properties

closed Future<void>
A future that resolves when the database is closed.
no setter
commits Stream<void>
A relayed stream of events triggered by commits from the remote worker.
no setter
fileSystem FileSystem
no setter
hashCode int
The hash code for this object.
no setterinherited
rollbacks Stream<void>
A relayed stream of events triggered by rollbacks from the remote worker.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updates Stream<SqliteUpdate>
A relayed stream of CommonDatabase.updates from the remote worker.
no setter

Methods

additionalConnection() Future<SqliteWebEndpoint>
Creates a MessagePort (a transferrable object that can be sent to another JavaScript context like a worker) that can be used with WebSqlite.connectToPort to open another instance of this database remotely.
customRequest(JSAny? request) Future<JSAny?>
Sends a custom request to the worker database.
dispose() Future<void>
Closes this database and instructs the worker to release associated resources.
execute(String sql, {List<Object?> parameters = const [], bool checkInTransaction = false, LockToken? token, Future<void>? abortTrigger}) Future<DatabaseResult<void>>
Prepares sql and executes it with the given parameters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestLock<T>(Future<T> body(LockToken lock), {Future<void>? abortTrigger}) Future<T>
Runs body with an exclusive lock on the database.
select(String sql, {List<Object?> parameters = const [], bool checkInTransaction = false, LockToken? token, Future<void>? abortTrigger}) Future<DatabaseResult<ResultSet>>
Prepares sql, executes it with the given parameters and returns the ResultSet.
toString() String
A string representation of this object.
inherited

Operators

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