public Result Open(byte[] filename, out IDbHandle db, int flags, IntPtr zvfs) { IntPtr dbPtr; Result r = SQLiteApiWin32Internal.sqlite3_open_v2(filename, out dbPtr, flags, zvfs); db = new DbHandle(dbPtr); return(r); }
public IDbStatement Prepare2(IDbHandle db, string query) { var internalDbHandle = (DbHandle)db; IntPtr stmt; Result r = SQLiteApiWin32Internal.sqlite3_prepare16_v2(internalDbHandle.DbPtr, query, -1, out stmt, IntPtr.Zero); if (r != Result.OK) { throw SQLiteException.New(r, Errmsg16(internalDbHandle)); } return(new DbStatement(stmt)); }
public int CreateCollation(IDbHandle db, ICollation collation) { var internalDbHandle = (DbHandle)db; var compareCallbackExecutor = new CompareCallbackExecutor( collation, SQLiteApiWin32Internal.GetCompareCallbackStringBytes); var func = new SQLiteApiWin32Internal.CompareCallback(compareCallbackExecutor.Execute); _allocatedGCHandles.Add(GCHandle.Alloc(func)); return(SQLiteApiWin32Internal.sqlite3_create_collation( internalDbHandle.DbPtr, Encoding.UTF8.GetBytes(collation.Name), SQLiteEncodings.SQLITE_UTF8, IntPtr.Zero, func)); }
public IDbBackupHandle BackupInit(IDbHandle destHandle, string destName, IDbHandle srcHandle, string srcName) { var internalDestDb = (DbHandle)destHandle; var internalSrcDb = (DbHandle)srcHandle; IntPtr p = SQLiteApiWin32Internal.sqlite3_backup_init(internalDestDb.DbPtr, destName, internalSrcDb.DbPtr, srcName); if (p == IntPtr.Zero) { return(null); } else { return(new DbBackupHandle(p)); } }
public int CreateScalarFunction(IDbHandle db, IScalarFunction sqliteFunction) { var internalDbHandle = (DbHandle)db; var funcCallbackExecutor = new FuncCallbackExecutor( sqliteFunction, SQLiteApiWin32Internal.GetAnsiString, SQLiteApiWin32Internal.sqlite3_result_int ); var func = new SQLiteApiWin32Internal.FuncCallback(funcCallbackExecutor.Execute); _allocatedGCHandles.Add(GCHandle.Alloc(func)); return(SQLiteApiWin32Internal.sqlite3_create_function( internalDbHandle.DbPtr, Encoding.UTF8.GetBytes(sqliteFunction.Name), sqliteFunction.ValueGetters.Length, SQLiteEncodings.SQLITE_UTF8, IntPtr.Zero, func, null, null)); }
public int Sleep(int millis) { return(SQLiteApiWin32Internal.sqlite3_sleep(millis)); }
public int LibVersionNumber() { return(SQLiteApiWin32Internal.sqlite3_libversion_number()); }
public int BackupRemaining(IDbBackupHandle handle) { var internalBackup = (DbBackupHandle)handle; return(SQLiteApiWin32Internal.sqlite3_backup_remaining(internalBackup.DbBackupPtr)); }
public int BackupPagecount(IDbBackupHandle handle) { var internalBackup = (DbBackupHandle)handle; return(SQLiteApiWin32Internal.sqlite3_backup_pagecount(internalBackup.DbBackupPtr)); }
public Result Shutdown() { return(SQLiteApiWin32Internal.sqlite3_shutdown()); }
public string ColumnName16(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.ColumnName16(internalStmt.StmtPtr, index)); }
public ExtendedResult ExtendedErrCode(IDbHandle db) { var internalDbHandle = (DbHandle)db; return(SQLiteApiWin32Internal.sqlite3_extended_errcode(internalDbHandle.DbPtr)); }
public Result Close(IDbHandle db) { var internalDbHandle = (DbHandle)db; return(SQLiteApiWin32Internal.sqlite3_close(internalDbHandle.DbPtr)); }
public int ColumnBytes(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_column_bytes(internalStmt.StmtPtr, index)); }
public byte[] ColumnByteArray(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.ColumnByteArray(internalStmt.StmtPtr, index)); }
public string ColumnText16(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(Marshal.PtrToStringUni(SQLiteApiWin32Internal.sqlite3_column_text16(internalStmt.StmtPtr, index))); }
public double ColumnDouble(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_column_double(internalStmt.StmtPtr, index)); }
public long ColumnInt64(IDbStatement stmt, int index) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_column_int64(internalStmt.StmtPtr, index)); }
public string SourceID() { return(Marshal.PtrToStringAnsi(SQLiteApiWin32Internal.sqlite3_sourceid())); }
public Result BusyTimeout(IDbHandle db, int milliseconds) { var internalDbHandle = (DbHandle)db; return(SQLiteApiWin32Internal.sqlite3_busy_timeout(internalDbHandle.DbPtr, milliseconds)); }
public Result EnableLoadExtension(IDbHandle db, int onoff) { var internalDbHandle = (DbHandle)db; return(SQLiteApiWin32Internal.sqlite3_enable_load_extension(internalDbHandle.DbPtr, onoff)); }
public int BindBlob(IDbStatement stmt, int index, byte[] val, int n, IntPtr free) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_bind_blob(internalStmt.StmtPtr, index, val, n, free)); }
public Result Initialize() { return(SQLiteApiWin32Internal.sqlite3_initialize()); }
public int BindText16(IDbStatement stmt, int index, string val, int n, IntPtr free) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_bind_text16(internalStmt.StmtPtr, index, val, n, free)); }
public Result Config(ConfigOption option) { return(SQLiteApiWin32Internal.sqlite3_config(option)); }
public int ColumnCount(IDbStatement stmt) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_column_count(internalStmt.StmtPtr)); }
public int Changes(IDbHandle db) { var internalDbHandle = (DbHandle)db; return(SQLiteApiWin32Internal.sqlite3_changes(internalDbHandle.DbPtr)); }
public Result BackupStep(IDbBackupHandle handle, int pageCount) { var internalBackup = (DbBackupHandle)handle; return(SQLiteApiWin32Internal.sqlite3_backup_step(internalBackup.DbBackupPtr, pageCount)); }
public Result Step(IDbStatement stmt) { var internalStmt = (DbStatement)stmt; return(SQLiteApiWin32Internal.sqlite3_step(internalStmt.StmtPtr)); }
public Result BackupFinish(IDbBackupHandle handle) { var internalBackup = (DbBackupHandle)handle; return(SQLiteApiWin32Internal.sqlite3_backup_finish(internalBackup.DbBackupPtr)); }