RuntimeSqlExecution extension

Parameterized SQL on the owning runtime or its borrowed session.

No models, schema registration, or generator are required. The same runtime can subsequently be passed to an ORM view without acquiring another pool.

on

Methods

query<R>(SqlQuery<R> query, {ExecutionOptions options = const ExecutionOptions(), Iterable<String> changedTables = const []}) → Future<List<R>>

Available on SqlDatabase<Backend>, provided by the RuntimeSqlExecution extension

Executes and decodes one statement using its actual result labels.
raw(Sql sql, {ExecutionOptions options = const ExecutionOptions(), Iterable<String> changedTables = const []}) → Future<SqlResult>

Available on SqlDatabase<Backend>, provided by the RuntimeSqlExecution extension

Executes one statement. Values are bound by Sql.compile.
streamSql<R>(SqlQuery<R> query, {int batchSize = 128, ExecutionOptions options = const ExecutionOptions()}) → Stream<R>

Available on SqlDatabase<Backend>, provided by the RuntimeSqlExecution extension

Streams typed rows through the runtime's bounded cursor.