edtris/diet-sqlite/codes.lua

281 lines
7.5 KiB
Lua

-- works with luajit ffi or https://github.com/q66/cffi-lua
local ffi = require "diet-sqlite.ffi"
return {
SQLITE_TRANSIENT = ffi.cast('void(*)(void*)', -1);
SQLITE_STATIC = ffi.cast('void(*)(void*)', 0);
log_callback_type = 'void(*)(void*,int,const char*)';
-- error codes
SQLITE_EMPTY = 16;
SQLITE_CANTOPEN = 14;
SQLITE_FULL = 13;
SQLITE_BUSY = 5;
SQLITE_FORMAT = 24;
SQLITE_READONLY = 8;
SQLITE_LOCKED = 6;
SQLITE_INTERNAL = 2;
SQLITE_ROW = 100;
SQLITE_PERM = 3;
SQLITE_CORRUPT = 11;
SQLITE_ABORT = 4;
SQLITE_SCHEMA = 17;
SQLITE_DONE = 101;
SQLITE_MISMATCH = 20;
SQLITE_OK = 0;
SQLITE_TOOBIG = 18;
SQLITE_AUTH = 23;
SQLITE_NOLFS = 22;
SQLITE_PROTOCOL = 15;
SQLITE_IOERR = 10;
SQLITE_CONSTRAINT = 19;
SQLITE_NOTADB = 26;
SQLITE_MISUSE = 21;
SQLITE_RANGE = 25;
SQLITE_NOMEM = 7;
SQLITE_ERROR = 1;
SQLITE_INTERRUPT = 9;
SQLITE_NOTFOUND = 12;
-- Codes
SQLITE_IOERR_BLOCKED = 2826;
SQLITE_LIMIT_EXPR_DEPTH = 3;
SQLITE_IOERR_SHMMAP = 5386;
SQLITE_ACCESS_READ = 2;
SQLITE_IOCAP_SAFE_APPEND = 512;
SQLITE_READONLY_CANTLOCK = 520;
SQLITE_CREATE_INDEX = 1;
SQLITE_STATUS_SCRATCH_SIZE = 8;
SQLITE_OPEN_MAIN_JOURNAL = 2048;
SQLITE_CREATE_VIEW = 8;
SQLITE_SET_LOCKPROXYFILE = 3;
SQLITE_CANTOPEN_NOTEMPDIR = 270;
SQLITE_NULL = 5;
SQLITE_IOCAP_ATOMIC1K = 4;
SQLITE_STATUS_PAGECACHE_OVERFLOW = 2;
SQLITE_SHM_SHARED = 4;
SQLITE_ANALYZE = 28;
SQLITE_FCNTL_WIN32_AV_RETRY = 9;
SQLITE_LOCKED_SHAREDCACHE = 262;
SQLITE_OPEN_TRANSIENT_DB = 1024;
SQLITE_TESTCTRL_ALWAYS = 13;
SQLITE_DBCONFIG_LOOKASIDE = 1001;
SQLITE_CREATE_TEMP_TRIGGER = 5;
SQLITE_IOERR_TRUNCATE = 1546;
SQLITE_IOERR_DELETE = 2570;
SQLITE_GET_LOCKPROXYFILE = 2;
SQLITE_FCNTL_SIZE_HINT = 5;
SQLITE_STATUS_SCRATCH_OVERFLOW = 4;
SQLITE_OPEN_MAIN_DB = 256;
SQLITE_STATUS_PARSER_STACK = 6;
SQLITE_OPEN_PRIVATECACHE = 262144;
SQLITE_FUNCTION = 31;
SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8;
SQLITE_IOERR_SEEK = 5642;
SQLITE_FCNTL_CHUNK_SIZE = 6;
SQLITE_DROP_TEMP_VIEW = 15;
SQLITE_DBSTATUS_LOOKASIDE_USED = 0;
SQLITE_IOCAP_POWERSAFE_OVERWRITE = 4096;
SQLITE_CONFIG_URI = 17;
SQLITE_IOERR_READ = 266;
SQLITE_ABORT = 4;
SQLITE_DBSTATUS_MAX = 9;
SQLITE_OPEN_FULLMUTEX = 65536;
SQLITE_IOCAP_ATOMIC64K = 256;
SQLITE_CREATE_TEMP_VIEW = 6;
SQLITE_ATTACH = 24;
SQLITE_CREATE_TRIGGER = 7;
SQLITE_MUTEX_FAST = 0;
SQLITE_REPLACE = 5;
SQLITE_TESTCTRL_PENDING_BYTE = 11;
SQLITE_DELETE = 9;
SQLITE_IOERR_DIR_FSYNC = 1290;
SQLITE_FCNTL_PRAGMA = 14;
SQLITE_FAIL = 3;
SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5;
SQLITE_STMTSTATUS_SORT = 2;
SQLITE_IOERR_LOCK = 3850;
SQLITE_VTAB_CONSTRAINT_SUPPORT = 1;
SQLITE_CHECKPOINT_RESTART = 2;
SQLITE_OPEN_READONLY = 1;
SQLITE_CONFIG_MUTEX = 10;
SQLITE_IOCAP_ATOMIC512 = 2;
SQLITE_FCNTL_VFSNAME = 12;
SQLITE_DBSTATUS_CACHE_HIT = 7;
SQLITE_IOERR_NOMEM = 3082;
SQLITE_CHECKPOINT_PASSIVE = 0;
SQLITE_IOERR_CHECKRESERVEDLOCK = 3594;
SQLITE_IOERR_RDLOCK = 2314;
SQLITE_STMTSTATUS_AUTOINDEX = 3;
SQLITE_ROLLBACK = 1;
SQLITE_UTF16BE = 3;
SQLITE_INDEX_CONSTRAINT_GE = 32;
SQLITE_IOERR_SHMOPEN = 4618;
SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 2048;
SQLITE_DBSTATUS_CACHE_WRITE = 9;
SQLITE_IOCAP_ATOMIC4K = 16;
SQLITE_LIMIT_VARIABLE_NUMBER = 9;
SQLITE_DBSTATUS_CACHE_MISS = 8;
SQLITE_CHECKPOINT_FULL = 1;
SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6;
SQLITE_DBSTATUS_LOOKASIDE_HIT = 4;
SQLITE_STATUS_PAGECACHE_SIZE = 7;
SQLITE_SYNC_NORMAL = 2;
SQLITE_DBSTATUS_SCHEMA_USED = 2;
SQLITE_CONFIG_SINGLETHREAD = 1;
SQLITE_LIMIT_SQL_LENGTH = 1;
SQLITE_FCNTL_FILE_POINTER = 7;
SQLITE_CREATE_TEMP_INDEX = 3;
SQLITE_READ = 20;
SQLITE_STATUS_MALLOC_COUNT = 9;
SQLITE_DBSTATUS_STMT_USED = 3;
SQLITE_SHM_EXCLUSIVE = 8;
SQLITE_INDEX_CONSTRAINT_LE = 8;
SQLITE_BUSY_RECOVERY = 261;
SQLITE_DROP_VIEW = 17;
SQLITE_TESTCTRL_PRNG_SAVE = 5;
SQLITE_OPEN_MASTER_JOURNAL = 16384;
SQLITE_PRAGMA = 19;
SQLITE_CONFIG_MALLOC = 4;
SQLITE_UTF16 = 4;
SQLITE_STATUS_MEMORY_USED = 0;
SQLITE_TESTCTRL_LAST = 19;
SQLITE_CONFIG_SERIALIZED = 3;
SQLITE_FCNTL_LOCKSTATE = 1;
SQLITE_OPEN_TEMP_DB = 512;
SQLITE_TESTCTRL_EXPLAIN_STMT = 19;
SQLITE_MUTEX_STATIC_PMEM = 7;
SQLITE_OPEN_SUBJOURNAL = 8192;
SQLITE_TESTCTRL_BITVEC_TEST = 8;
SQLITE_DROP_TRIGGER = 16;
SQLITE_ALTER_TABLE = 26;
SQLITE_IOERR_UNLOCK = 2058;
SQLITE_CONFIG_GETMALLOC = 5;
SQLITE_SHM_LOCK = 2;
SQLITE_DROP_TEMP_TABLE = 13;
SQLITE_FLOAT = 2;
SQLITE_OPEN_CREATE = 4;
SQLITE_TESTCTRL_RESERVE = 14;
SQLITE_TESTCTRL_ASSERT = 12;
SQLITE_FCNTL_OVERWRITE = 11;
SQLITE_STATUS_MALLOC_SIZE = 5;
SQLITE_OPEN_SHAREDCACHE = 131072;
SQLITE_OPEN_URI = 64;
SQLITE_TESTCTRL_SCRATCHMALLOC = 17;
SQLITE_DROP_TABLE = 11;
SQLITE_TESTCTRL_PRNG_RESET = 7;
SQLITE_CREATE_TEMP_TABLE = 4;
SQLITE_TESTCTRL_PRNG_RESTORE = 6;
SQLITE_STATUS_SCRATCH_USED = 3;
SQLITE_LIMIT_TRIGGER_DEPTH = 10;
SQLITE_MUTEX_STATIC_LRU2 = 7;
SQLITE_TESTCTRL_FIRST = 5;
SQLITE_OPEN_AUTOPROXY = 32;
SQLITE_SYNC_FULL = 3;
SQLITE_TESTCTRL_LOCALTIME_FAULT = 18;
SQLITE_TESTCTRL_FAULT_INSTALL = 9;
SQLITE_MUTEX_STATIC_PRNG = 5;
SQLITE_MUTEX_STATIC_OPEN = 4;
SQLITE_MUTEX_STATIC_MEM2 = 4;
SQLITE_TRANSACTION = 22;
SQLITE_MUTEX_STATIC_MEM = 3;
SQLITE_IOERR_DIR_CLOSE = 4362;
SQLITE_MUTEX_STATIC_MASTER = 2;
SQLITE_MUTEX_RECURSIVE = 1;
SQLITE_CREATE_VTABLE = 29;
SQLITE_CONFIG_SCRATCH = 6;
SQLITE_STMTSTATUS_FULLSCAN_STEP = 1;
SQLITE_INDEX_CONSTRAINT_LT = 16;
SQLITE_MUTEX_STATIC_LRU = 6;
SQLITE_DBCONFIG_ENABLE_TRIGGER = 1003;
SQLITE_CONFIG_MEMSTATUS = 9;
SQLITE_BLOB = 4;
SQLITE_UTF16_ALIGNED = 8;
SQLITE_DETACH = 25;
SQLITE_STATUS_PAGECACHE_USED = 1;
SQLITE_FCNTL_PERSIST_WAL = 10;
SQLITE_IOERR_SHORT_READ = 522;
SQLITE_UTF16LE = 2;
SQLITE_UTF8 = 1;
SQLITE_TEXT = 3;
SQLITE_INDEX_CONSTRAINT_EQ = 2;
SQLITE_IOERR_SHMSIZE = 4874;
SQLITE_INSERT = 18;
SQLITE_LOCK_RESERVED = 2;
SQLITE_LIMIT_ATTACHED = 7;
SQLITE_LIMIT_COLUMN = 2;
SQLITE_IOERR_FSTAT = 1802;
SQLITE_CONFIG_LOOKASIDE = 13;
SQLITE_CONFIG_GETPCACHE2 = 19;
SQLITE_READONLY_RECOVERY = 264;
SQLITE_CONFIG_GETMUTEX = 11;
SQLITE_IOCAP_ATOMIC16K = 64;
SQLITE_LIMIT_FUNCTION_ARG = 6;
SQLITE_REINDEX = 27;
SQLITE_OPEN_READWRITE = 2;
SQLITE_COPY = 0;
SQLITE_SAVEPOINT = 32;
SQLITE_DROP_VTABLE = 30;
SQLITE_IOERR_CLOSE = 4106;
SQLITE_INDEX_CONSTRAINT_MATCH = 64;
SQLITE_ANY = 5;
SQLITE_UPDATE = 23;
SQLITE_SELECT = 21;
SQLITE_DROP_INDEX = 10;
SQLITE_INDEX_CONSTRAINT_GT = 4;
SQLITE_IOCAP_SEQUENTIAL = 1024;
SQLITE_CONFIG_PAGECACHE = 7;
SQLITE_TESTCTRL_OPTIMIZATIONS = 15;
SQLITE_IOERR_ACCESS = 3338;
SQLITE_IOCAP_ATOMIC = 1;
SQLITE_TESTCTRL_ISKEYWORD = 16;
SQLITE_IOCAP_ATOMIC32K = 128;
SQLITE_DROP_TEMP_TRIGGER = 14;
SQLITE_OPEN_WAL = 524288;
SQLITE_OPEN_EXCLUSIVE = 16;
SQLITE_CORRUPT_VTAB = 267;
SQLITE_OPEN_TEMP_JOURNAL = 4096;
SQLITE_CANTOPEN_ISDIR = 526;
SQLITE_OPEN_DELETEONCLOSE = 8;
SQLITE_CONFIG_HEAP = 8;
SQLITE_INTEGER = 1;
SQLITE_ACCESS_EXISTS = 0;
SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13;
SQLITE_LIMIT_VDBE_OP = 5;
SQLITE_IOERR_FSYNC = 1034;
SQLITE_LOCK_SHARED = 1;
SQLITE_IOCAP_ATOMIC2K = 8;
SQLITE_LOCK_EXCLUSIVE = 4;
SQLITE_DBSTATUS_CACHE_USED = 1;
SQLITE_LOCK_PENDING = 3;
SQLITE_SYNC_DATAONLY = 16;
SQLITE_DENY = 1;
SQLITE_DROP_TEMP_INDEX = 12;
SQLITE_LAST_ERRNO = 4;
SQLITE_FCNTL_SYNC_OMITTED = 8;
SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS = 10;
SQLITE_CONFIG_LOG = 16;
SQLITE_OPEN_NOMUTEX = 32768;
SQLITE_DBCONFIG_ENABLE_FKEY = 1002;
SQLITE_IGNORE = 2;
SQLITE_IOERR_WRITE = 778;
SQLITE_IOERR_SHMLOCK = 5130;
SQLITE_CONFIG_MULTITHREAD = 2;
SQLITE_ABORT_ROLLBACK = 516;
SQLITE_SHM_NLOCK = 8;
SQLITE_CONFIG_PCACHE = 14;
SQLITE_LIMIT_COMPOUND_SELECT = 4;
SQLITE_ACCESS_READWRITE = 1;
SQLITE_CONFIG_PCACHE2 = 18;
SQLITE_IOCAP_ATOMIC8K = 32;
SQLITE_LOCK_NONE = 0;
SQLITE_CREATE_TABLE = 2;
SQLITE_LIMIT_LENGTH = 0;
SQLITE_CONFIG_GETPCACHE = 15;
SQLITE_SHM_UNLOCK = 1;
SQLITE_PREPARE_PERSISTENT = 0x01;
SQLITE_PREPARE_NORMALIZE = 0x02;
SQLITE_PREPARE_NO_VTAB = 0x04;
}