QueryContext class abstract

Capabilities and an optional execution binding for typed query descriptions. The SQL layer knows no connection pool, platform adapter or runtime session.

Implementers
Available extensions

Constructors

QueryContext()
Creates a context for compiling or executing query descriptions.
const

Properties

capabilities Capabilities
The selected engine's limits and supported SQL features.
no setter
dialect SqlDialect
The SQL dialect selected by the context's capabilities.
no setter
hashCode int
The hash code for this object.
no setterinherited
inSession bool
Whether this view borrows one leased connection.
no setter
inTransaction bool
Whether this view borrows an active transaction.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute(SqlCommand command, {ExecutionOptions options = const ExecutionOptions(), Iterable<TableSchema> changedTables = const []}) Future<SqlResult>
Executes bound SQL and declares tables affected by raw writes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query<R>(SqlQuery<R> query, {ExecutionOptions options = const ExecutionOptions(), Iterable<TableSchema> changedTables = const []}) Future<List<R>>

Available on QueryContext, provided by the SqlExecution extension

Executes once and decodes the actual metadata and rows. No wrapper or LIMIT is added. Use this for SELECT or native DML RETURNING.
raw(Sql sql, {ExecutionOptions options = const ExecutionOptions(), Iterable<TableSchema> changedTables = const []}) Future<SqlResult>

Available on QueryContext, provided by the SqlExecution extension

Executes exactly the supplied statement and returns positional rows, labels and write metadata. Raw writes declare changedTables for watches.
registerSchema(Iterable<TableSchema> tables) → void
Registers foreign-key effects for change subscriptions.
run<R>(Future<R> action(SqlConnection), {AcquisitionOptions acquire = const AcquisitionOptions()}) Future<R>
Executes work on a leased connection, or rejects an unbound context.
streamSql<R>(SqlQuery<R> query, {int batchSize = 128, ExecutionOptions options = const ExecutionOptions()}) Stream<R>

Available on QueryContext, provided by the SqlExecution extension

Streams typed rows through one cursor with bounded batch fetching. Compilation is immediate; a connection is acquired on listen. Result labels are bound on the first batch, even when empty, without a second query. Cancel or finish before leaving a session/transaction callback.
table<R, F extends Fields>(Table<R, F> definition) TableSet<R, F>
Binds a manual or generated table definition to this context.
toString() String
A string representation of this object.
inherited

Operators

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