execute method

Future<WriteResult> execute(
  1. String sql, [
  2. List<Object?> parameters = const []
])

Executes a write statement within this transaction.

Same as Database.execute, but the write is part of the enclosing transaction and only commits when the transaction completes.

Throws StateError if called after the enclosing transaction body has returned.

Implementation

Future<WriteResult> execute(
  String sql, [
  List<Object?> parameters = const [],
]) async {
  _ensureActive();
  final response = await _writer.execute(sql, parameters);
  return response.result;
}