createBatch method

IBatch createBatch(
  1. IStatus status,
  2. ITransaction transaction,
  3. String sqlStmt, [
  4. int dialect = FbConsts.sqlDialectCurrent,
  5. IMessageMetadata? inMetadata,
  6. int parLength = 0,
  7. Pointer<Uint8>? par,
])

Implementation

IBatch createBatch(IStatus status, ITransaction transaction, String sqlStmt,
    [int dialect = FbConsts.sqlDialectCurrent,
    IMessageMetadata? inMetadata,
    int parLength = 0,
    Pointer<Uint8>? par]) {
  if (version < 4) {
    throw UnimplementedError(
        "Firebird client library version 4 or later required.");
  }
  final sqlUtf = sqlStmt.toNativeUtf8(allocator: mem);
  try {
    final res = _createBatch(self, status.self, transaction.self, 0, sqlUtf,
        dialect, inMetadata?.self ?? nullptr, parLength, par ?? nullptr);
    status.checkStatus();
    return IBatch(res);
  } finally {
    mem.free(sqlUtf);
  }
}