execute method

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

Execute INSERT, UPDATE, DELETE commands

Implementation

Future<int> execute(String sql, [List<dynamic>? parameters]) async {
  _ensureConnected();

  try {
    final result = await _channel.invokeMethod('execute', {
      'connectionId': _connectionId,
      'sql': sql,
      'parameters': parameters ?? [],
    });

    return result as int? ?? 0;
  } on PlatformException catch (e) {
    throw QueryException(
      'Execute command failed',
      details: e.details as String?,
    );
  }
}