QueryExecutor class abstract

A query executor is responsible for executing statements on a database and return their results in a raw form.

This is an internal api of drift, which can break often. If you want to implement custom database backends, consider using the new backends API. The NativeDatabase implementation might be useful as a reference. If you want to write your own database engine to use with drift and run into issues, please consider creating an issue.

If you want to wrap an existing QueryExecutor, e.g. to change its behavior for some methods or to add logs in a custom format, consider using the QueryInterceptor API.

Implementers
Available extensions

Constructors

QueryExecutor()

Properties

dialect SqlDialect
The SqlDialect to use for this database engine.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

beginExclusive() QueryExecutor
Returns a new QueryExecutor that, when first opened, takes an exclusive lock over this executor and prevents queries from running until it is closed.
beginTransaction() TransactionExecutor
Starts a TransactionExecutor.
close() Future<void>
Closes this database connection and releases all resources associated with it. Implementations should also handle close calls in a state where the database isn't open.
ensureOpen(QueryExecutorUser user) Future<bool>
Opens the executor, if it has not yet been opened.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runBatched(BatchedStatements statements) Future<void>
Prepares and runs statements.
runCustom(String statement, [List<Object?>? args]) Future<void>
Runs a custom SQL statement without any variables. The result of that statement will be ignored.
runDelete(String statement, List<Object?> args) Future<int>
Runs an delete statement and returns how many rows where affected.
runInsert(String statement, List<Object?> args) Future<int>
Runs an insert statement with the given variables. Returns the row id or the auto_increment id of the inserted row.
runSelect(String statement, List<Object?> args) Future<List<Map<String, Object?>>>
Runs a select statement with the given variables and returns the raw results.
runUpdate(String statement, List<Object?> args) Future<int>
Runs an update statement with the given variables and returns how many rows where affected.
toString() String
A string representation of this object.
inherited

Operators

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