prepare_v3 method

int prepare_v3(
  1. PtrSqlite3 db,
  2. String zSql,
  3. int prepFlags,
  4. PtrPtrStmt ppStmt,
  5. PtrPtrUtf8 pzTail,
)
inherited

Implementation

int prepare_v3(PtrSqlite3 db, String zSql, int prepFlags, PtrPtrStmt ppStmt, PtrPtrUtf8 pzTail) {
  if (libVersionNumber < 3020000) {
    throw dbsql.DatabaseException('API sqlite3_prepare_v3 is not available before 3.20.0');
  }
  final zSqlMeta = zSql._metaNativeUtf8();
  final ptrZSql = zSqlMeta.ptr;
  try {
    var result = _h_sqlite3_prepare_v3!(db, ptrZSql, zSqlMeta.length, prepFlags, ppStmt, pzTail);
    if (pzTail.value.address - ptrZSql.address == zSqlMeta.length) {
      pzTail.value = ffi.nullptr;
    }
    return result;
  } finally {
    pkgffi.malloc.free(ptrZSql);
  }
}