execute method

  1. @override
Future<int> execute(
  1. String sql, [
  2. List? arguments
])
override

Executes non-selecting commands (UPDATE, DELETE) or schema changes (DDL).

Implementation

@override
Future<int> execute(String sql, [List<dynamic>? arguments]) async {
  lastSql = sql;
  lastArgs = arguments;
  history.add(sql);

  if (_inTransaction) {
    transactionHistory.add(sql);

    if (shouldFailTransaction) {
      throw Exception('Simulated transaction failure');
    }

    return 1;
  }
  return 1;
}