Ejemplo n.º 1
0
        public string Errmsg16(IDbHandle db)
        {
            var dbHandle = (DbHandle)db;

            if (_useWinSqlite)
            {
                return(WinSQLite3.GetErrmsg(dbHandle.InternalDbHandle));
            }
            else
            {
                return(SQLite3.GetErrmsg(dbHandle.InternalDbHandle));
            }
        }
Ejemplo n.º 2
0
        public IDbStatement Prepare2(IDbHandle db, string query)
        {
            var dbHandle = (DbHandle)db;
            var stmt     = default(Sqlite3Statement);

            if (_useWinSqlite)
            {
                var r = WinSQLite3.Prepare2(dbHandle.InternalDbHandle, query, query.Length, out stmt, IntPtr.Zero);
                if (r != Result.OK)
                {
                    throw SQLiteException.New(r, WinSQLite3.GetErrmsg(dbHandle.InternalDbHandle));
                }
            }
            else
            {
                var r = SQLite3.Prepare2(dbHandle.InternalDbHandle, query, query.Length, out stmt, IntPtr.Zero);
                if (r != Result.OK)
                {
                    throw SQLiteException.New(r, SQLite3.GetErrmsg(dbHandle.InternalDbHandle));
                }
            }

            return(new DbStatement(stmt));
        }