internal static void Bind(sqlite3 db, sqlite3_stmt stm, int index, object value)
        {
            int rc = 0;

            if (value == null)
            {
                rc = raw.sqlite3_bind_null(stm, index);
            }
            else
            {
                if (IsSupportedInteger(value))
                {
                    rc = raw.sqlite3_bind_int64(stm, index, GetInteger(value));
                }
                else if (IsSupportedFloat(value))
                {
                    rc = raw.sqlite3_bind_double(stm, index, GetFloat(value));
                }
                else if (IsSupportedText(value))
                {
                    rc = raw.sqlite3_bind_text(stm, index, value.ToString());
                }
                else if (value is byte[])
                {
                    rc = raw.sqlite3_bind_blob(stm, index, (byte[])value);
                }
                else
                {
                    throw new SQLiteException("Unable to bind parameter with unsupported type: " + value.GetType().FullName);
                }
            }

            VerifySQLiteResponse(rc, raw.SQLITE_OK, db);
        }
示例#2
0
 internal Cursor (sqlite3_stmt stmt, object dbLock)
 {
     this.dbLock = dbLock;
     this.statement = stmt;
     currentRow = -1;
     lock (dbLock) { currentStep = statement.step(); }
 }
示例#3
0
 static public int sqlite3_reset(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_reset(stmt.ptr));
 }
示例#4
0
 static public int sqlite3_prepare_v2(sqlite3 db, string sql, out sqlite3_stmt stmt, out string tail)
 {
     IntPtr p;
     int rc = _imp.sqlite3_prepare_v2(db.ptr, sql, out p, out tail);
     stmt = new sqlite3_stmt(p, db);
     return rc;
 }
示例#5
0
 static public int sqlite3_stmt_readonly(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_stmt_readonly(stmt.ptr);
 }
示例#6
0
 static public long sqlite3_column_int64(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_int64(stmt.ptr, index);
 }
示例#7
0
 static public int sqlite3_bind_blob(sqlite3_stmt stmt, int index, byte[] blob)
 {
     return _imp.sqlite3_bind_blob(stmt.ptr, index, blob);
 }
示例#8
0
 static public int sqlite3_bind_text(sqlite3_stmt stmt, int index, string val)
 {
     return _imp.sqlite3_bind_text(stmt.ptr, index, val);
 }
示例#9
0
 static public int sqlite3_bind_blob(sqlite3_stmt stmt, int index, byte[] blob)
 {
     return(sqlite3_bind_blob(stmt, index, blob, blob.Length));
 }
示例#10
0
        static public sqlite3 sqlite3_db_handle(sqlite3_stmt stmt)
        {
#if not
            IntPtr p = _imp.sqlite3_db_handle(stmt.ptr);
            Assert(p == stmt.db.ptr);
#endif
            return stmt.db;
        }
示例#11
0
 static public int sqlite3_bind_zeroblob(sqlite3_stmt stmt, int index, int size)
 {
     return(_imp.sqlite3_bind_zeroblob(stmt.ptr, index, size));
 }
示例#12
0
 static public string sqlite3_bind_parameter_name(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_bind_parameter_name(stmt.ptr, index));
 }
示例#13
0
 static public string sqlite3_sql(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_sql(stmt.ptr));
 }
示例#14
0
 public static int sqlite3_stmt_status(sqlite3_stmt stmt, int op, int resetFlg)
 {
     return(_imp.sqlite3_stmt_status(stmt.ptr, op, resetFlg));
 }
示例#15
0
 static public int sqlite3_clear_bindings(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_clear_bindings(stmt.ptr));
 }
示例#16
0
 static public int sqlite3_reset(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_reset(stmt.ptr);
 }
示例#17
0
 static public int sqlite3_bind_blob(sqlite3_stmt stmt, int index, byte[] blob, int nSize)
 {
     return(_imp.sqlite3_bind_blob(stmt.ptr, index, blob, nSize));
 }
示例#18
0
 public static int sqlite3_stmt_status(sqlite3_stmt stmt, int op, int resetFlg)
 {
     return _imp.sqlite3_stmt_status(stmt.ptr, op, resetFlg);
 }
示例#19
0
 static public int sqlite3_bind_double(sqlite3_stmt stmt, int index, double val)
 {
     return(_imp.sqlite3_bind_double(stmt.ptr, index, val));
 }
示例#20
0
 static public int sqlite3_bind_zeroblob(sqlite3_stmt stmt, int index, int size)
 {
     return _imp.sqlite3_bind_zeroblob(stmt.ptr, index, size);
 }
示例#21
0
 static public int sqlite3_bind_int64(sqlite3_stmt stmt, int index, long val)
 {
     return(_imp.sqlite3_bind_int64(stmt.ptr, index, val));
 }
示例#22
0
 static public int sqlite3_bind_int64(sqlite3_stmt stmt, int index, long val)
 {
     return _imp.sqlite3_bind_int64(stmt.ptr, index, val);
 }
示例#23
0
 static public int sqlite3_bind_null(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_bind_null(stmt.ptr, index));
 }
示例#24
0
 static public int sqlite3_bind_parameter_index(sqlite3_stmt stmt, string strName)
 {
     return _imp.sqlite3_bind_parameter_index(stmt.ptr, strName);
 }
示例#25
0
 static public int sqlite3_bind_text(sqlite3_stmt stmt, int index, string val)
 {
     return(_imp.sqlite3_bind_text(stmt.ptr, index, val));
 }
示例#26
0
 static public int sqlite3_data_count(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_data_count(stmt.ptr);
 }
示例#27
0
 static public int sqlite3_bind_parameter_count(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_bind_parameter_count(stmt.ptr));
 }
示例#28
0
 static public int sqlite3_column_type(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_type(stmt.ptr, index);
 }
示例#29
0
 static public int sqlite3_bind_parameter_index(sqlite3_stmt stmt, string strName)
 {
     return(_imp.sqlite3_bind_parameter_index(stmt.ptr, strName));
 }
示例#30
0
 static public int sqlite3_prepare_v2(sqlite3 db, string sql, out sqlite3_stmt stmt)
 {
     string tail;
     return sqlite3_prepare_v2(db, sql, out stmt, out tail);
 }
示例#31
0
 static public int sqlite3_stmt_busy(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_stmt_busy(stmt.ptr));
 }
示例#32
0
 static public int sqlite3_finalize(sqlite3_stmt stmt)
 {
     int rc = _imp.sqlite3_finalize(stmt.ptr);
     stmt.set_already_disposed();
     return rc;
 }
示例#33
0
 static public int sqlite3_stmt_readonly(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_stmt_readonly(stmt.ptr));
 }
示例#34
0
 static public int sqlite3_clear_bindings(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_clear_bindings(stmt.ptr);
 }
示例#35
0
 static public string sqlite3_column_table_name(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_table_name(stmt.ptr, index));
 }
示例#36
0
 static public string sqlite3_sql(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_sql(stmt.ptr);
 }
示例#37
0
 static public int sqlite3_data_count(sqlite3_stmt stmt)
 {
     return(_imp.sqlite3_data_count(stmt.ptr));
 }
示例#38
0
        static public sqlite3_stmt sqlite3_next_stmt(sqlite3 db, sqlite3_stmt stmt)
        {
            IntPtr prev = IntPtr.Zero;
            if (stmt != null)
            {
                prev = stmt.ptr;
            }

            IntPtr p = _imp.sqlite3_next_stmt(db.ptr, prev);

            if (p == IntPtr.Zero)
            {
                return null;
            }
            else
            {
                return db.find_stmt(p);
            }
        }
示例#39
0
 static public double sqlite3_column_double(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_double(stmt.ptr, index));
 }
示例#40
0
 static public string sqlite3_bind_parameter_name(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_bind_parameter_name(stmt.ptr, index);
 }
示例#41
0
 static public long sqlite3_column_int64(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_int64(stmt.ptr, index));
 }
示例#42
0
 static public int sqlite3_bind_double(sqlite3_stmt stmt, int index, double val)
 {
     return _imp.sqlite3_bind_double(stmt.ptr, index, val);
 }
示例#43
0
 static public byte[] sqlite3_column_blob(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_blob(stmt.ptr, index));
 }
示例#44
0
 static public int sqlite3_bind_null(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_bind_null(stmt.ptr, index);
 }
示例#45
0
 static public int sqlite3_column_blob(sqlite3_stmt stmt, int index, byte[] result, int offset)
 {
     return(_imp.sqlite3_column_blob(stmt.ptr, index, result, offset));
 }
示例#46
0
 static public int sqlite3_bind_parameter_count(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_bind_parameter_count(stmt.ptr);
 }
示例#47
0
 static public int sqlite3_column_type(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_type(stmt.ptr, index));
 }
示例#48
0
 static public int sqlite3_stmt_busy(sqlite3_stmt stmt)
 {
     return _imp.sqlite3_stmt_busy(stmt.ptr);
 }
示例#49
0
 static public string sqlite3_column_decltype(sqlite3_stmt stmt, int index)
 {
     return(_imp.sqlite3_column_decltype(stmt.ptr, index));
 }
示例#50
0
 static public string sqlite3_column_table_name(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_table_name(stmt.ptr, index);
 }
示例#51
0
 public void Open()
 {
     statement = SQLite3.Prepare2(database.Handle, query);
 }
示例#52
0
 static public double sqlite3_column_double(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_double(stmt.ptr, index);
 }
示例#53
0
 internal void add_stmt(sqlite3_stmt stmt)
 {
     _stmts[stmt.ptr] = stmt;
 }
示例#54
0
 static public byte[] sqlite3_column_blob(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_blob(stmt.ptr, index);
 }
示例#55
0
 internal void remove_stmt(sqlite3_stmt s)
 {
     _stmts.Remove(s.ptr);
 }
示例#56
0
 static public string sqlite3_column_decltype(sqlite3_stmt stmt, int index)
 {
     return _imp.sqlite3_column_decltype(stmt.ptr, index);
 }
示例#57
0
        static public int sqlite3_prepare_v2(sqlite3 db, string sql, out sqlite3_stmt stmt)
        {
            string tail;

            return(sqlite3_prepare_v2(db, sql, out stmt, out tail));
        }