public static SafeSqliteBlobHandle sqlite3_blob_open(SafeSqliteHandle db, string sdb, string table, string col, long rowid, int flags, out Result result) { using var _ = db.Lease(); result = (Result)raw.sqlite3_blob_open(db.DangerousGetHandle(), sdb, table, col, rowid, flags, out var wrapper); if (result != (int)Result.OK) { wrapper = null; } try { // Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid // will be true when the handle is not usable, but the handle instance can be disposed either way. return(new SafeSqliteBlobHandle(db, wrapper)); } catch { raw.sqlite3_blob_close(wrapper); throw; } }
public static SafeSqliteStatementHandle sqlite3_prepare_v2(SafeSqliteHandle db, string sql, out Result result) { using var _ = db.Lease(); result = (Result)raw.sqlite3_prepare_v2(db.DangerousGetHandle(), sql, out var wrapper); if (result != (int)Result.OK) { wrapper = null; } try { // Always return a non-null handle to match default P/Invoke marshaling behavior. SafeHandle.IsInvalid // will be true when the handle is not usable, but the handle instance can be disposed either way. return(new SafeSqliteStatementHandle(db, wrapper)); } catch { raw.sqlite3_finalize(wrapper); throw; } }
public static Result sqlite3_busy_timeout(SafeSqliteHandle db, int ms) { using var _ = db.Lease(); return((Result)raw.sqlite3_busy_timeout(db.DangerousGetHandle(), ms)); }
public static int sqlite3_extended_errcode(SafeSqliteHandle db) { using var _ = db.Lease(); return(raw.sqlite3_extended_errcode(db.DangerousGetHandle())); }
public static string sqlite3_errmsg(SafeSqliteHandle db) { using var _ = db.Lease(); return(raw.sqlite3_errmsg(db.DangerousGetHandle())); }
public static long sqlite3_last_insert_rowid(SafeSqliteHandle db) { using var _ = db.Lease(); return(raw.sqlite3_last_insert_rowid(db.DangerousGetHandle())); }