get method

Future<List<R>> get({
  1. ExecutionOptions options = const ExecutionOptions(),
})

Executes the query and decodes all selected rows.

Relation batches reuse the same connection. Use an explicit transaction when a consistent snapshot across multiple statements is required.

Implementation

Future<List<R>> get({ExecutionOptions options = const ExecutionOptions()}) {
  options.check();
  return database.run((connection) async {
    final (plan, decode) = planQuery();
    final command = compileQuery(plan);
    final result = await database.executeOn(
      connection,
      command,
      options: options,
    );
    final rows = await expandRelations(
      database,
      connection,
      plan,
      result.rows,
      options: options,
    );
    return database.observeDecode(
      command.sql,
      rows.length,
      () => [for (final row in rows) decode(row)],
    );
  }, acquire: options.acquisition);
}