Ejemplo n.º 1
0
        public IDbStatement Prepare2(IDbHandle db, string query)
        {
            var    internalDbHandle = (DbHandle)db;
            IntPtr stmt;
            Result r = SQLiteApiSqlCipherInternal.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));
        }
Ejemplo n.º 2
0
        public Result Open(byte[] filename, out IDbHandle db, int flags, IntPtr zvfs, byte[] key)
        {
            IntPtr dbPtr;
            Result r = SQLiteApiSqlCipherInternal.sqlite3_open_v2(filename, out dbPtr, flags, zvfs);

            db = new DbHandle(dbPtr);
            if (dbPtr != IntPtr.Zero && key != null) // key
            {
                SQLiteApiSqlCipherInternal.sqlite3_key(dbPtr, key, key.Length);
            }
            return(r);
        }
Ejemplo n.º 3
0
        public IDbBackupHandle BackupInit(IDbHandle destHandle, string destName, IDbHandle srcHandle, string srcName)
        {
            var internalDestDb = (DbHandle)destHandle;
            var internalSrcDb  = (DbHandle)srcHandle;

            IntPtr p = SQLiteApiSqlCipherInternal.sqlite3_backup_init(internalDestDb.DbPtr,
                                                                      destName,
                                                                      internalSrcDb.DbPtr,
                                                                      srcName);

            if (p == IntPtr.Zero)
            {
                return(null);
            }
            else
            {
                return(new DbBackupHandle(p));
            }
        }
Ejemplo n.º 4
0
        public int BackupRemaining(IDbBackupHandle handle)
        {
            var internalBackup = (DbBackupHandle)handle;

            return(SQLiteApiSqlCipherInternal.sqlite3_backup_remaining(internalBackup.DbBackupPtr));
        }
Ejemplo n.º 5
0
        public int BackupPagecount(IDbBackupHandle handle)
        {
            var internalBackup = (DbBackupHandle)handle;

            return(SQLiteApiSqlCipherInternal.sqlite3_backup_pagecount(internalBackup.DbBackupPtr));
        }
Ejemplo n.º 6
0
        public int BindDouble(IDbStatement stmt, int index, double val)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_bind_double(internalStmt.StmtPtr, index, val));
        }
Ejemplo n.º 7
0
        public int BindInt64(IDbStatement stmt, int index, long val)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_bind_int64(internalStmt.StmtPtr, index, val));
        }
Ejemplo n.º 8
0
        public Result Close(IDbHandle db)
        {
            var internalDbHandle = (DbHandle)db;

            return(SQLiteApiSqlCipherInternal.sqlite3_close(internalDbHandle.DbPtr));
        }
Ejemplo n.º 9
0
        public int BindBlob(IDbStatement stmt, int index, byte[] val, int n, IntPtr free)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_bind_blob(internalStmt.StmtPtr, index, val, n, free));
        }
Ejemplo n.º 10
0
        public int ColumnBytes(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_column_bytes(internalStmt.StmtPtr, index));
        }
Ejemplo n.º 11
0
 public string SourceID()
 {
     return(Marshal.PtrToStringAnsi(SQLiteApiSqlCipherInternal.sqlite3_sourceid()));
 }
Ejemplo n.º 12
0
        public double ColumnDouble(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_column_double(internalStmt.StmtPtr, index));
        }
Ejemplo n.º 13
0
        public string ColumnText16(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(Marshal.PtrToStringUni(SQLiteApiSqlCipherInternal.sqlite3_column_text16(internalStmt.StmtPtr, index)));
        }
Ejemplo n.º 14
0
        public long ColumnInt64(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_column_int64(internalStmt.StmtPtr, index));
        }
Ejemplo n.º 15
0
        public string ColumnName16(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.ColumnName16(internalStmt.StmtPtr, index));
        }
Ejemplo n.º 16
0
        public int ColumnCount(IDbStatement stmt)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_column_count(internalStmt.StmtPtr));
        }
Ejemplo n.º 17
0
 public int Sleep(int millis)
 {
     return(SQLiteApiSqlCipherInternal.sqlite3_sleep(millis));
 }
Ejemplo n.º 18
0
        public byte[] ColumnByteArray(IDbStatement stmt, int index)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.ColumnByteArray(internalStmt.StmtPtr, index));
        }
Ejemplo n.º 19
0
 public int LibVersionNumber()
 {
     return(SQLiteApiSqlCipherInternal.sqlite3_libversion_number());
 }
Ejemplo n.º 20
0
 public Result Shutdown()
 {
     return(SQLiteApiSqlCipherInternal.sqlite3_shutdown());
 }
Ejemplo n.º 21
0
        public Result EnableLoadExtension(IDbHandle db, int onoff)
        {
            var internalDbHandle = (DbHandle)db;

            return(SQLiteApiSqlCipherInternal.sqlite3_enable_load_extension(internalDbHandle.DbPtr, onoff));
        }
Ejemplo n.º 22
0
        public Result BusyTimeout(IDbHandle db, int milliseconds)
        {
            var internalDbHandle = (DbHandle)db;

            return(SQLiteApiSqlCipherInternal.sqlite3_busy_timeout(internalDbHandle.DbPtr, milliseconds));
        }
Ejemplo n.º 23
0
 public Result Initialize()
 {
     return(SQLiteApiSqlCipherInternal.sqlite3_initialize());
 }
Ejemplo n.º 24
0
        public int BindText16(IDbStatement stmt, int index, string val, int n, IntPtr free)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_bind_text16(internalStmt.StmtPtr, index, val, n, free));
        }
Ejemplo n.º 25
0
 public Result Config(ConfigOption option)
 {
     return(SQLiteApiSqlCipherInternal.sqlite3_config(option));
 }
Ejemplo n.º 26
0
        public ExtendedResult ExtendedErrCode(IDbHandle db)
        {
            var internalDbHandle = (DbHandle)db;

            return(SQLiteApiSqlCipherInternal.sqlite3_extended_errcode(internalDbHandle.DbPtr));
        }
Ejemplo n.º 27
0
        public int Changes(IDbHandle db)
        {
            var internalDbHandle = (DbHandle)db;

            return(SQLiteApiSqlCipherInternal.sqlite3_changes(internalDbHandle.DbPtr));
        }
Ejemplo n.º 28
0
        public Result BackupStep(IDbBackupHandle handle, int pageCount)
        {
            var internalBackup = (DbBackupHandle)handle;

            return(SQLiteApiSqlCipherInternal.sqlite3_backup_step(internalBackup.DbBackupPtr, pageCount));
        }
Ejemplo n.º 29
0
        public Result Step(IDbStatement stmt)
        {
            var internalStmt = (DbStatement)stmt;

            return(SQLiteApiSqlCipherInternal.sqlite3_step(internalStmt.StmtPtr));
        }
Ejemplo n.º 30
0
        public Result BackupFinish(IDbBackupHandle handle)
        {
            var internalBackup = (DbBackupHandle)handle;

            return(SQLiteApiSqlCipherInternal.sqlite3_backup_finish(internalBackup.DbBackupPtr));
        }