DatabaseExecutor class abstract interface

Executes typed SQLx-style queries against a database connection, transaction, or driver.

Generated DAO code receives a DatabaseExecutor and calls fetchOptional, fetchAll, fetchOne, fetchScalar, or execute depending on the annotated method return type.

Implementers

Properties

driver Driver
Database driver used by this executor.
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

close() Future<Result<Unit, SqlxError>>
Closes resources owned by this driver.
execute(String sql, List<Object?> parameters) Future<Result<ExecResult, SqlxError>>
Runs a checked statement and returns execution metadata.
fetchAll<T>(String sql, List<Object?> parameters, RowMapper<T> mapper) Future<Result<List<T>, SqlxError>>
Runs a checked row query that returns all rows.
fetchOne<T>(String sql, List<Object?> parameters, RowMapper<T> mapper) Future<Result<T, SqlxError>>
Runs a checked row query that must return exactly one row.
fetchOptional<T>(String sql, List<Object?> parameters, RowMapper<T> mapper) Future<Result<T?, SqlxError>>
Runs a checked row query that returns zero or one row.
fetchScalar<T>(String sql, List<Object?> parameters) Future<Result<T, SqlxError>>
Runs a checked scalar query and reads column index zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transaction<T>(Future<Result<T, SqlxError>> fn(Executor tx)) Future<Result<T, SqlxError>>
Runs fn inside a database transaction.

Operators

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