db_filename method

String? db_filename(
  1. PtrSqlite3 db,
  2. String zDbName
)
inherited

Implementation

String? db_filename(PtrSqlite3 db, String zDbName) {
  if (libVersionNumber < 3007010) {
    throw dbsql.DatabaseException('API sqlite3_db_filename is not available before 3.7.10');
  }
  final zDbNameMeta = zDbName._metaNativeUtf8();
  final ptrZDbName = zDbNameMeta.ptr;
  PtrString result = ffi.nullptr;
  try {
    var result = _h_sqlite3_db_filename!(db, ptrZDbName);
    return result == ffi.nullptr ? null : result.toDartString();
  } finally {
    pkgffi.malloc.free(ptrZDbName);
    pkgffi.malloc.free(result);
  }
}