get method

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

Executes the mutation and decodes all rows from RETURNING.

Returned row order is determined by the database and has no implicit sort.

Implementation

Future<List<R>> get({
  ExecutionOptions options = const ExecutionOptions(),
}) async {
  final plan = SelectionPlan();
  final decode = querySelection.bindSelection(plan);
  final command = _mutation.compileQuery(plan);
  final result = await _mutation.database.executeCommand(
    command,
    options: options,
    changedTables: [_mutation.queryState.source.schema],
    affectedOnly: true,
    cascade: _mutation.mutationKind == MutationKind.delete,
  );
  return _mutation.database.observeDecode(
    command.sql,
    result.rows.length,
    () => [for (final row in result.rows) decode(row)],
  );
}