handleExecute method

Future handleExecute({
  1. required String sql,
  2. List? sqlArguments,
})

Handle execute.

Implementation

Future handleExecute({required String sql, List? sqlArguments}) async {
  logSql(sql: sql, sqlArguments: sqlArguments);
  //database.ffiDb.execute(sql);
  if (sqlArguments?.isNotEmpty ?? false) {
    var preparedStatement = _ffiDb.prepare(sql);
    try {
      preparedStatement.execute(_ffiArguments(sqlArguments));
      return null;
    } finally {
      preparedStatement.dispose();
    }
  } else {
    _ffiDb.execute(sql);
  }
}