当前位置: 首页>>代码示例>>C#>>正文


C# SQLitePCL.sqlite3类代码示例

本文整理汇总了C#中SQLitePCL.sqlite3的典型用法代码示例。如果您正苦于以下问题:C# sqlite3类的具体用法?C# sqlite3怎么用?C# sqlite3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


sqlite3类属于SQLitePCL命名空间,在下文中一共展示了sqlite3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSqliteStatement

 internal static sqlite3_stmt GetSqliteStatement(string sql, sqlite3 db)
 {
     sqlite3_stmt statement;
     int rc= raw.sqlite3_prepare_v2(db, sql, out statement);
     VerifySQLiteResponse(rc, raw.SQLITE_OK, db);
     return statement;
 }
开发者ID:aziel,项目名称:azure-mobile-apps-net-client,代码行数:7,代码来源:SQLitePCLRawHelpers.cs

示例2: Bind

        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);
        }
开发者ID:aziel,项目名称:azure-mobile-apps-net-client,代码行数:34,代码来源:SQLitePCLRawHelpers.cs

示例3: VerifySQLiteResponse

 internal static void VerifySQLiteResponse(int result, int expectedResult, sqlite3 db)
 {
     if (result != expectedResult)
     {
         string sqliteErrorMessage = raw.sqlite3_errmsg(db);
         throw new SQLiteException(string.Format("Error executing SQLite command: '{0}'.", sqliteErrorMessage));
     }
 }
开发者ID:aziel,项目名称:azure-mobile-apps-net-client,代码行数:8,代码来源:SQLitePCLRawHelpers.cs

示例4: BuildCommand

        private sqlite3_stmt BuildCommand(sqlite3 db, string sql, object[] paramArgs)
        {
            if (db == null) {
                throw new ArgumentNullException("db");
            }

            sqlite3_stmt command = null;
            try
            {
                if (!IsOpen) {
                    Open(Path);
                }

                lock(Cursor.StmtDisposeLock)
                {
                    LastErrorCode = raw.sqlite3_prepare_v2(db, sql, out command);
                }

                if (LastErrorCode != raw.SQLITE_OK || command == null)
                {
                    Log.E(TAG, "sqlite3_prepare_v2: " + LastErrorCode);
                }

                if (paramArgs != null && paramArgs.Length > 0 && command != null && LastErrorCode != raw.SQLITE_ERROR)
                {
                    command.bind(paramArgs);
                }
            }
            catch (Exception e)
            {
                Log.E(TAG, "Error when build a sql " + sql + " with params " + paramArgs, e);
                throw;
            }

            return command;
        }
开发者ID:artcode-interactive,项目名称:couchbase-lite-net,代码行数:36,代码来源:SqlitePclRawStorageEngine.cs

示例5: OpenSqliteConnection

        void OpenSqliteConnection(int flags, SymmetricKey encryptionKey, out sqlite3 db)
        {
            LastErrorCode = raw.sqlite3_open_v2(Path, out db, flags, null);
            if (LastErrorCode != raw.SQLITE_OK) {
                Path = null;
                var errMessage = "Failed to open SQLite storage engine at path {0}".Fmt(Path);
                throw new CouchbaseLiteException(errMessage, StatusCode.DbError);
            }

#if !__ANDROID__ && !NET_3_5 && VERBOSE
                var i = 0;
                var val = raw.sqlite3_compileoption_get(i);
                while (val != null)
                {
                    Log.V(TAG, "Sqlite Config: {0}".Fmt(val));
                    val = raw.sqlite3_compileoption_get(++i);
                }
#endif

            Log.D(TAG, "Open {0} (flags={1}{2})", Path, flags, (encryptionKey != null ? ", encryption key given" : ""));

            raw.sqlite3_create_collation(db, "JSON", null, CouchbaseSqliteJsonUnicodeCollationFunction.Compare);
            raw.sqlite3_create_collation(db, "JSON_ASCII", null, CouchbaseSqliteJsonAsciiCollationFunction.Compare);
            raw.sqlite3_create_collation(db, "JSON_RAW", null, CouchbaseSqliteJsonRawCollationFunction.Compare);
            raw.sqlite3_create_collation(db, "REVID", null, CouchbaseSqliteRevIdCollationFunction.Compare);
        }
开发者ID:artcode-interactive,项目名称:couchbase-lite-net,代码行数:26,代码来源:SqlitePclRawStorageEngine.cs

示例6: sqlite3_wal_checkpoint

 static public int sqlite3_wal_checkpoint(sqlite3 db, string dbName)
 {
     return _imp.sqlite3_wal_checkpoint(db.ptr, dbName);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例7: sqlite3_blob_open

 static public int sqlite3_blob_open(sqlite3 db, string sdb, string table, string col, long rowid, int flags, out sqlite3_blob blob)
 {
     IntPtr p;
     int rc = _imp.sqlite3_blob_open(db.ptr, sdb, table, col, rowid, flags, out p);
     blob = new sqlite3_blob(p);
     return rc;
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:7,代码来源:raw.cs

示例8: sqlite3_next_stmt

        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);
            }
        }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:19,代码来源:raw.cs

示例9: sqlite3_exec

 static public int sqlite3_exec(sqlite3 db, string sql)
 {
     string errmsg;
     return _imp.sqlite3_exec(db.ptr, sql, null, null, out errmsg);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:5,代码来源:raw.cs

示例10: sqlite3_db_filename

 static public string sqlite3_db_filename(sqlite3 db, string att)
 {
     return _imp.sqlite3_db_filename(db.ptr, att);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例11: sqlite3_db_readonly

 static public int sqlite3_db_readonly(sqlite3 db, string dbName)
 {
     return _imp.sqlite3_db_readonly(db.ptr, dbName);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例12: sqlite3_errmsg

 static public string sqlite3_errmsg(sqlite3 db)
 {
     return _imp.sqlite3_errmsg(db.ptr);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例13: sqlite3_db_status

 static public int sqlite3_db_status(sqlite3 db, int op, out int current, out int highest, int resetFlg)
 {
     return _imp.sqlite3_db_status(db.ptr, op, out current, out highest, resetFlg);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例14: sqlite3_create_function

 static public int sqlite3_create_function(sqlite3 db, string name, int nArg, object v, delegate_function_aggregate_step func_step, delegate_function_aggregate_final func_final)
 {
     return _imp.sqlite3_create_function(db.ptr, name, nArg, v, func_step, func_final);
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:4,代码来源:raw.cs

示例15: sqlite3_prepare_v2

 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;
 }
开发者ID:shiftkey,项目名称:SQLitePCL.raw,代码行数:7,代码来源:raw.cs


注:本文中的SQLitePCL.sqlite3类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。