DatabaseDelegate class abstract
An interface that supports sending database queries. Used as a backend for drift.
Database implementations should support the following types both for variables and result sets:
- Inheritance
-
- Object
- QueryDelegate
- DatabaseDelegate
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInTransaction ↔ bool
-
Whether the database managed by this delegate is in a transaction at the
moment. This field is only set when the transactionDelegate is a
NoTransactionDelegate, because in that case transactions are run on
this delegate.
getter/setter pair
-
isOpen
→ FutureOr<
bool> -
A future that completes with
true
when this database is open and withfalse
when its not. The future may never complete with an error or with null. It should return relatively quickly, as drift queries it before each statement it sends to the database.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transactionDelegate → TransactionDelegate
-
The way this database engine starts transactions.
no setter
- versionDelegate → DbVersionDelegate
-
Returns an appropriate class to resolve the current schema version in
this database.
no setter
Methods
-
close(
) → Future< void> - Closes this database. When the future completes, all resources used by this database should have been disposed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyDatabaseOpened(
OpeningDetails details) → void - Callback from drift after the database has been fully opened and all migrations ran.
-
open(
QueryExecutorUser db) → Future< void> - Opens the database. Drift will only call this when isOpen has returned false before. Further, drift will not attempt to open a database multiple times, so you don't have to worry about a connection being created multiple times.
-
runBatched(
BatchedStatements statements) → Future< void> -
Runs multiple
statements
without having to prepare the same statement multiple times.inherited -
runCustom(
String statement, List< Object?> args) → Future<void> -
Runs a custom
statement
with the givenargs
. Ignores all results, but throws when the statement can't be executed.inherited -
runInsert(
String statement, List< Object?> args) → Future<int> -
Prepares and executes the
statement
with the variables bound toargs
. The statement will be anINSERT
statement.inherited -
runSelect(
String statement, List< Object?> args) → Future<QueryResult> -
Prepares and executes the
statement
, binding the variables toargs
. Its safe to assume that thestatement
is a select statement, the QueryResult that it returns should be returned from here.inherited -
runUpdate(
String statement, List< Object?> args) → Future<int> -
Prepares and executes the
statement
with the variables bound toargs
. The statement will either be anUPDATE
orDELETE
statement.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited