open_v2 method

int open_v2(
  1. String filename,
  2. PtrPtrSqlite3 ppDb,
  3. int flags,
  4. String? zVfs,
)
inherited

Implementation

int open_v2(String filename, PtrPtrSqlite3 ppDb, int flags, String? zVfs) {
  if (libVersionNumber < 3005000) {
    throw dbsql.DatabaseException('API sqlite3_open_v2 is not available before 3.5.0');
  }
  final filenameMeta = filename._metaNativeUtf8();
  final ptrFilename = filenameMeta.ptr;
  final zVfsMeta = zVfs?._metaNativeUtf8();
  final ptrZVfs = zVfsMeta?.ptr ?? ffi.nullptr;
  try {
    return _h_sqlite3_open_v2!(ptrFilename, ppDb, flags, ptrZVfs);
  } finally {
    pkgffi.malloc.free(ptrFilename);
    pkgffi.malloc.free(ptrZVfs);
  }
}