diff --git a/Cargo.toml b/Cargo.toml index 98bfcb4..ebc2bac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rusqlite" -version = "0.10.1" +version = "0.11.0" authors = ["John Gallagher "] description = "Ergonomic wrapper for SQLite" repository = "https://github.com/jgallagher/rusqlite" @@ -43,7 +43,7 @@ regex = "0.2" [dependencies.libsqlite3-sys] path = "libsqlite3-sys" -version = "0.7" +version = "0.8" [dependencies.csv] version = "0.14" diff --git a/Changelog.md b/Changelog.md index 5df3a74..cca0d8f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,8 @@ +# Version 0.11.0 (2017-04-06) + +* Avoid publicly exporting SQLite constants multiple times from libsqlite3-sys. +* Adds `FromSql` and `ToSql` impls for `isize`. Documents why `usize` and `u64` are not included. + # Version 0.10.1 (2017-03-03) * Updates the `bundled` SQLite version to 3.17.0. diff --git a/libsqlite3-sys/Cargo.toml b/libsqlite3-sys/Cargo.toml index fa41abe..e56b66e 100644 --- a/libsqlite3-sys/Cargo.toml +++ b/libsqlite3-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libsqlite3-sys" -version = "0.7.1" +version = "0.8.0" authors = ["John Gallagher "] repository = "https://github.com/jgallagher/rusqlite" description = "Native bindings to the libsqlite3 library" @@ -20,6 +20,7 @@ min_sqlite_version_3_6_23 = ["pkg-config"] min_sqlite_version_3_7_3 = ["pkg-config"] min_sqlite_version_3_7_4 = ["pkg-config"] min_sqlite_version_3_7_7 = ["pkg-config"] +min_sqlite_version_3_7_16 = ["pkg-config"] [build-dependencies] bindgen = { version = "0.21", optional = true } diff --git a/libsqlite3-sys/bindgen-bindings/bindgen_3.7.16.rs b/libsqlite3-sys/bindgen-bindings/bindgen_3.7.16.rs new file mode 100644 index 0000000..cd14895 --- /dev/null +++ b/libsqlite3-sys/bindgen-bindings/bindgen_3.7.16.rs @@ -0,0 +1,2297 @@ +/* automatically generated by rust-bindgen */ + +pub const __GNUC_VA_LIST: i32 = 1; +pub const SQLITE_VERSION: &'static [u8; 7usize] = b"3.7.16\x00"; +pub const SQLITE_VERSION_NUMBER: i32 = 3007016; +pub const SQLITE_SOURCE_ID: &'static [u8; 61usize] = + b"2013-03-18 11:39:23 66d5f2b76750f3520eb7a495f6247206758f5b90\x00"; +pub const SQLITE_OK: i32 = 0; +pub const SQLITE_ERROR: i32 = 1; +pub const SQLITE_INTERNAL: i32 = 2; +pub const SQLITE_PERM: i32 = 3; +pub const SQLITE_ABORT: i32 = 4; +pub const SQLITE_BUSY: i32 = 5; +pub const SQLITE_LOCKED: i32 = 6; +pub const SQLITE_NOMEM: i32 = 7; +pub const SQLITE_READONLY: i32 = 8; +pub const SQLITE_INTERRUPT: i32 = 9; +pub const SQLITE_IOERR: i32 = 10; +pub const SQLITE_CORRUPT: i32 = 11; +pub const SQLITE_NOTFOUND: i32 = 12; +pub const SQLITE_FULL: i32 = 13; +pub const SQLITE_CANTOPEN: i32 = 14; +pub const SQLITE_PROTOCOL: i32 = 15; +pub const SQLITE_EMPTY: i32 = 16; +pub const SQLITE_SCHEMA: i32 = 17; +pub const SQLITE_TOOBIG: i32 = 18; +pub const SQLITE_CONSTRAINT: i32 = 19; +pub const SQLITE_MISMATCH: i32 = 20; +pub const SQLITE_MISUSE: i32 = 21; +pub const SQLITE_NOLFS: i32 = 22; +pub const SQLITE_AUTH: i32 = 23; +pub const SQLITE_FORMAT: i32 = 24; +pub const SQLITE_RANGE: i32 = 25; +pub const SQLITE_NOTADB: i32 = 26; +pub const SQLITE_ROW: i32 = 100; +pub const SQLITE_DONE: i32 = 101; +pub const SQLITE_IOERR_READ: i32 = 266; +pub const SQLITE_IOERR_SHORT_READ: i32 = 522; +pub const SQLITE_IOERR_WRITE: i32 = 778; +pub const SQLITE_IOERR_FSYNC: i32 = 1034; +pub const SQLITE_IOERR_DIR_FSYNC: i32 = 1290; +pub const SQLITE_IOERR_TRUNCATE: i32 = 1546; +pub const SQLITE_IOERR_FSTAT: i32 = 1802; +pub const SQLITE_IOERR_UNLOCK: i32 = 2058; +pub const SQLITE_IOERR_RDLOCK: i32 = 2314; +pub const SQLITE_IOERR_DELETE: i32 = 2570; +pub const SQLITE_IOERR_BLOCKED: i32 = 2826; +pub const SQLITE_IOERR_NOMEM: i32 = 3082; +pub const SQLITE_IOERR_ACCESS: i32 = 3338; +pub const SQLITE_IOERR_CHECKRESERVEDLOCK: i32 = 3594; +pub const SQLITE_IOERR_LOCK: i32 = 3850; +pub const SQLITE_IOERR_CLOSE: i32 = 4106; +pub const SQLITE_IOERR_DIR_CLOSE: i32 = 4362; +pub const SQLITE_IOERR_SHMOPEN: i32 = 4618; +pub const SQLITE_IOERR_SHMSIZE: i32 = 4874; +pub const SQLITE_IOERR_SHMLOCK: i32 = 5130; +pub const SQLITE_IOERR_SHMMAP: i32 = 5386; +pub const SQLITE_IOERR_SEEK: i32 = 5642; +pub const SQLITE_IOERR_DELETE_NOENT: i32 = 5898; +pub const SQLITE_LOCKED_SHAREDCACHE: i32 = 262; +pub const SQLITE_BUSY_RECOVERY: i32 = 261; +pub const SQLITE_CANTOPEN_NOTEMPDIR: i32 = 270; +pub const SQLITE_CANTOPEN_ISDIR: i32 = 526; +pub const SQLITE_CANTOPEN_FULLPATH: i32 = 782; +pub const SQLITE_CORRUPT_VTAB: i32 = 267; +pub const SQLITE_READONLY_RECOVERY: i32 = 264; +pub const SQLITE_READONLY_CANTLOCK: i32 = 520; +pub const SQLITE_READONLY_ROLLBACK: i32 = 776; +pub const SQLITE_ABORT_ROLLBACK: i32 = 516; +pub const SQLITE_CONSTRAINT_CHECK: i32 = 275; +pub const SQLITE_CONSTRAINT_COMMITHOOK: i32 = 531; +pub const SQLITE_CONSTRAINT_FOREIGNKEY: i32 = 787; +pub const SQLITE_CONSTRAINT_FUNCTION: i32 = 1043; +pub const SQLITE_CONSTRAINT_NOTNULL: i32 = 1299; +pub const SQLITE_CONSTRAINT_PRIMARYKEY: i32 = 1555; +pub const SQLITE_CONSTRAINT_TRIGGER: i32 = 1811; +pub const SQLITE_CONSTRAINT_UNIQUE: i32 = 2067; +pub const SQLITE_CONSTRAINT_VTAB: i32 = 2323; +pub const SQLITE_OPEN_READONLY: i32 = 1; +pub const SQLITE_OPEN_READWRITE: i32 = 2; +pub const SQLITE_OPEN_CREATE: i32 = 4; +pub const SQLITE_OPEN_DELETEONCLOSE: i32 = 8; +pub const SQLITE_OPEN_EXCLUSIVE: i32 = 16; +pub const SQLITE_OPEN_AUTOPROXY: i32 = 32; +pub const SQLITE_OPEN_URI: i32 = 64; +pub const SQLITE_OPEN_MEMORY: i32 = 128; +pub const SQLITE_OPEN_MAIN_DB: i32 = 256; +pub const SQLITE_OPEN_TEMP_DB: i32 = 512; +pub const SQLITE_OPEN_TRANSIENT_DB: i32 = 1024; +pub const SQLITE_OPEN_MAIN_JOURNAL: i32 = 2048; +pub const SQLITE_OPEN_TEMP_JOURNAL: i32 = 4096; +pub const SQLITE_OPEN_SUBJOURNAL: i32 = 8192; +pub const SQLITE_OPEN_MASTER_JOURNAL: i32 = 16384; +pub const SQLITE_OPEN_NOMUTEX: i32 = 32768; +pub const SQLITE_OPEN_FULLMUTEX: i32 = 65536; +pub const SQLITE_OPEN_SHAREDCACHE: i32 = 131072; +pub const SQLITE_OPEN_PRIVATECACHE: i32 = 262144; +pub const SQLITE_OPEN_WAL: i32 = 524288; +pub const SQLITE_IOCAP_ATOMIC: i32 = 1; +pub const SQLITE_IOCAP_ATOMIC512: i32 = 2; +pub const SQLITE_IOCAP_ATOMIC1K: i32 = 4; +pub const SQLITE_IOCAP_ATOMIC2K: i32 = 8; +pub const SQLITE_IOCAP_ATOMIC4K: i32 = 16; +pub const SQLITE_IOCAP_ATOMIC8K: i32 = 32; +pub const SQLITE_IOCAP_ATOMIC16K: i32 = 64; +pub const SQLITE_IOCAP_ATOMIC32K: i32 = 128; +pub const SQLITE_IOCAP_ATOMIC64K: i32 = 256; +pub const SQLITE_IOCAP_SAFE_APPEND: i32 = 512; +pub const SQLITE_IOCAP_SEQUENTIAL: i32 = 1024; +pub const SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: i32 = 2048; +pub const SQLITE_IOCAP_POWERSAFE_OVERWRITE: i32 = 4096; +pub const SQLITE_LOCK_NONE: i32 = 0; +pub const SQLITE_LOCK_SHARED: i32 = 1; +pub const SQLITE_LOCK_RESERVED: i32 = 2; +pub const SQLITE_LOCK_PENDING: i32 = 3; +pub const SQLITE_LOCK_EXCLUSIVE: i32 = 4; +pub const SQLITE_SYNC_NORMAL: i32 = 2; +pub const SQLITE_SYNC_FULL: i32 = 3; +pub const SQLITE_SYNC_DATAONLY: i32 = 16; +pub const SQLITE_FCNTL_LOCKSTATE: i32 = 1; +pub const SQLITE_GET_LOCKPROXYFILE: i32 = 2; +pub const SQLITE_SET_LOCKPROXYFILE: i32 = 3; +pub const SQLITE_LAST_ERRNO: i32 = 4; +pub const SQLITE_FCNTL_SIZE_HINT: i32 = 5; +pub const SQLITE_FCNTL_CHUNK_SIZE: i32 = 6; +pub const SQLITE_FCNTL_FILE_POINTER: i32 = 7; +pub const SQLITE_FCNTL_SYNC_OMITTED: i32 = 8; +pub const SQLITE_FCNTL_WIN32_AV_RETRY: i32 = 9; +pub const SQLITE_FCNTL_PERSIST_WAL: i32 = 10; +pub const SQLITE_FCNTL_OVERWRITE: i32 = 11; +pub const SQLITE_FCNTL_VFSNAME: i32 = 12; +pub const SQLITE_FCNTL_POWERSAFE_OVERWRITE: i32 = 13; +pub const SQLITE_FCNTL_PRAGMA: i32 = 14; +pub const SQLITE_FCNTL_BUSYHANDLER: i32 = 15; +pub const SQLITE_FCNTL_TEMPFILENAME: i32 = 16; +pub const SQLITE_ACCESS_EXISTS: i32 = 0; +pub const SQLITE_ACCESS_READWRITE: i32 = 1; +pub const SQLITE_ACCESS_READ: i32 = 2; +pub const SQLITE_SHM_UNLOCK: i32 = 1; +pub const SQLITE_SHM_LOCK: i32 = 2; +pub const SQLITE_SHM_SHARED: i32 = 4; +pub const SQLITE_SHM_EXCLUSIVE: i32 = 8; +pub const SQLITE_SHM_NLOCK: i32 = 8; +pub const SQLITE_CONFIG_SINGLETHREAD: i32 = 1; +pub const SQLITE_CONFIG_MULTITHREAD: i32 = 2; +pub const SQLITE_CONFIG_SERIALIZED: i32 = 3; +pub const SQLITE_CONFIG_MALLOC: i32 = 4; +pub const SQLITE_CONFIG_GETMALLOC: i32 = 5; +pub const SQLITE_CONFIG_SCRATCH: i32 = 6; +pub const SQLITE_CONFIG_PAGECACHE: i32 = 7; +pub const SQLITE_CONFIG_HEAP: i32 = 8; +pub const SQLITE_CONFIG_MEMSTATUS: i32 = 9; +pub const SQLITE_CONFIG_MUTEX: i32 = 10; +pub const SQLITE_CONFIG_GETMUTEX: i32 = 11; +pub const SQLITE_CONFIG_LOOKASIDE: i32 = 13; +pub const SQLITE_CONFIG_PCACHE: i32 = 14; +pub const SQLITE_CONFIG_GETPCACHE: i32 = 15; +pub const SQLITE_CONFIG_LOG: i32 = 16; +pub const SQLITE_CONFIG_URI: i32 = 17; +pub const SQLITE_CONFIG_PCACHE2: i32 = 18; +pub const SQLITE_CONFIG_GETPCACHE2: i32 = 19; +pub const SQLITE_CONFIG_COVERING_INDEX_SCAN: i32 = 20; +pub const SQLITE_CONFIG_SQLLOG: i32 = 21; +pub const SQLITE_DBCONFIG_LOOKASIDE: i32 = 1001; +pub const SQLITE_DBCONFIG_ENABLE_FKEY: i32 = 1002; +pub const SQLITE_DBCONFIG_ENABLE_TRIGGER: i32 = 1003; +pub const SQLITE_DENY: i32 = 1; +pub const SQLITE_IGNORE: i32 = 2; +pub const SQLITE_CREATE_INDEX: i32 = 1; +pub const SQLITE_CREATE_TABLE: i32 = 2; +pub const SQLITE_CREATE_TEMP_INDEX: i32 = 3; +pub const SQLITE_CREATE_TEMP_TABLE: i32 = 4; +pub const SQLITE_CREATE_TEMP_TRIGGER: i32 = 5; +pub const SQLITE_CREATE_TEMP_VIEW: i32 = 6; +pub const SQLITE_CREATE_TRIGGER: i32 = 7; +pub const SQLITE_CREATE_VIEW: i32 = 8; +pub const SQLITE_DELETE: i32 = 9; +pub const SQLITE_DROP_INDEX: i32 = 10; +pub const SQLITE_DROP_TABLE: i32 = 11; +pub const SQLITE_DROP_TEMP_INDEX: i32 = 12; +pub const SQLITE_DROP_TEMP_TABLE: i32 = 13; +pub const SQLITE_DROP_TEMP_TRIGGER: i32 = 14; +pub const SQLITE_DROP_TEMP_VIEW: i32 = 15; +pub const SQLITE_DROP_TRIGGER: i32 = 16; +pub const SQLITE_DROP_VIEW: i32 = 17; +pub const SQLITE_INSERT: i32 = 18; +pub const SQLITE_PRAGMA: i32 = 19; +pub const SQLITE_READ: i32 = 20; +pub const SQLITE_SELECT: i32 = 21; +pub const SQLITE_TRANSACTION: i32 = 22; +pub const SQLITE_UPDATE: i32 = 23; +pub const SQLITE_ATTACH: i32 = 24; +pub const SQLITE_DETACH: i32 = 25; +pub const SQLITE_ALTER_TABLE: i32 = 26; +pub const SQLITE_REINDEX: i32 = 27; +pub const SQLITE_ANALYZE: i32 = 28; +pub const SQLITE_CREATE_VTABLE: i32 = 29; +pub const SQLITE_DROP_VTABLE: i32 = 30; +pub const SQLITE_FUNCTION: i32 = 31; +pub const SQLITE_SAVEPOINT: i32 = 32; +pub const SQLITE_COPY: i32 = 0; +pub const SQLITE_LIMIT_LENGTH: i32 = 0; +pub const SQLITE_LIMIT_SQL_LENGTH: i32 = 1; +pub const SQLITE_LIMIT_COLUMN: i32 = 2; +pub const SQLITE_LIMIT_EXPR_DEPTH: i32 = 3; +pub const SQLITE_LIMIT_COMPOUND_SELECT: i32 = 4; +pub const SQLITE_LIMIT_VDBE_OP: i32 = 5; +pub const SQLITE_LIMIT_FUNCTION_ARG: i32 = 6; +pub const SQLITE_LIMIT_ATTACHED: i32 = 7; +pub const SQLITE_LIMIT_LIKE_PATTERN_LENGTH: i32 = 8; +pub const SQLITE_LIMIT_VARIABLE_NUMBER: i32 = 9; +pub const SQLITE_LIMIT_TRIGGER_DEPTH: i32 = 10; +pub const SQLITE_INTEGER: i32 = 1; +pub const SQLITE_FLOAT: i32 = 2; +pub const SQLITE_BLOB: i32 = 4; +pub const SQLITE_NULL: i32 = 5; +pub const SQLITE_TEXT: i32 = 3; +pub const SQLITE3_TEXT: i32 = 3; +pub const SQLITE_UTF8: i32 = 1; +pub const SQLITE_UTF16LE: i32 = 2; +pub const SQLITE_UTF16BE: i32 = 3; +pub const SQLITE_UTF16: i32 = 4; +pub const SQLITE_ANY: i32 = 5; +pub const SQLITE_UTF16_ALIGNED: i32 = 8; +pub const SQLITE_INDEX_CONSTRAINT_EQ: i32 = 2; +pub const SQLITE_INDEX_CONSTRAINT_GT: i32 = 4; +pub const SQLITE_INDEX_CONSTRAINT_LE: i32 = 8; +pub const SQLITE_INDEX_CONSTRAINT_LT: i32 = 16; +pub const SQLITE_INDEX_CONSTRAINT_GE: i32 = 32; +pub const SQLITE_INDEX_CONSTRAINT_MATCH: i32 = 64; +pub const SQLITE_MUTEX_FAST: i32 = 0; +pub const SQLITE_MUTEX_RECURSIVE: i32 = 1; +pub const SQLITE_MUTEX_STATIC_MASTER: i32 = 2; +pub const SQLITE_MUTEX_STATIC_MEM: i32 = 3; +pub const SQLITE_MUTEX_STATIC_MEM2: i32 = 4; +pub const SQLITE_MUTEX_STATIC_OPEN: i32 = 4; +pub const SQLITE_MUTEX_STATIC_PRNG: i32 = 5; +pub const SQLITE_MUTEX_STATIC_LRU: i32 = 6; +pub const SQLITE_MUTEX_STATIC_LRU2: i32 = 7; +pub const SQLITE_MUTEX_STATIC_PMEM: i32 = 7; +pub const SQLITE_TESTCTRL_FIRST: i32 = 5; +pub const SQLITE_TESTCTRL_PRNG_SAVE: i32 = 5; +pub const SQLITE_TESTCTRL_PRNG_RESTORE: i32 = 6; +pub const SQLITE_TESTCTRL_PRNG_RESET: i32 = 7; +pub const SQLITE_TESTCTRL_BITVEC_TEST: i32 = 8; +pub const SQLITE_TESTCTRL_FAULT_INSTALL: i32 = 9; +pub const SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: i32 = 10; +pub const SQLITE_TESTCTRL_PENDING_BYTE: i32 = 11; +pub const SQLITE_TESTCTRL_ASSERT: i32 = 12; +pub const SQLITE_TESTCTRL_ALWAYS: i32 = 13; +pub const SQLITE_TESTCTRL_RESERVE: i32 = 14; +pub const SQLITE_TESTCTRL_OPTIMIZATIONS: i32 = 15; +pub const SQLITE_TESTCTRL_ISKEYWORD: i32 = 16; +pub const SQLITE_TESTCTRL_SCRATCHMALLOC: i32 = 17; +pub const SQLITE_TESTCTRL_LOCALTIME_FAULT: i32 = 18; +pub const SQLITE_TESTCTRL_EXPLAIN_STMT: i32 = 19; +pub const SQLITE_TESTCTRL_LAST: i32 = 19; +pub const SQLITE_STATUS_MEMORY_USED: i32 = 0; +pub const SQLITE_STATUS_PAGECACHE_USED: i32 = 1; +pub const SQLITE_STATUS_PAGECACHE_OVERFLOW: i32 = 2; +pub const SQLITE_STATUS_SCRATCH_USED: i32 = 3; +pub const SQLITE_STATUS_SCRATCH_OVERFLOW: i32 = 4; +pub const SQLITE_STATUS_MALLOC_SIZE: i32 = 5; +pub const SQLITE_STATUS_PARSER_STACK: i32 = 6; +pub const SQLITE_STATUS_PAGECACHE_SIZE: i32 = 7; +pub const SQLITE_STATUS_SCRATCH_SIZE: i32 = 8; +pub const SQLITE_STATUS_MALLOC_COUNT: i32 = 9; +pub const SQLITE_DBSTATUS_LOOKASIDE_USED: i32 = 0; +pub const SQLITE_DBSTATUS_CACHE_USED: i32 = 1; +pub const SQLITE_DBSTATUS_SCHEMA_USED: i32 = 2; +pub const SQLITE_DBSTATUS_STMT_USED: i32 = 3; +pub const SQLITE_DBSTATUS_LOOKASIDE_HIT: i32 = 4; +pub const SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE: i32 = 5; +pub const SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL: i32 = 6; +pub const SQLITE_DBSTATUS_CACHE_HIT: i32 = 7; +pub const SQLITE_DBSTATUS_CACHE_MISS: i32 = 8; +pub const SQLITE_DBSTATUS_CACHE_WRITE: i32 = 9; +pub const SQLITE_DBSTATUS_MAX: i32 = 9; +pub const SQLITE_STMTSTATUS_FULLSCAN_STEP: i32 = 1; +pub const SQLITE_STMTSTATUS_SORT: i32 = 2; +pub const SQLITE_STMTSTATUS_AUTOINDEX: i32 = 3; +pub const SQLITE_CHECKPOINT_PASSIVE: i32 = 0; +pub const SQLITE_CHECKPOINT_FULL: i32 = 1; +pub const SQLITE_CHECKPOINT_RESTART: i32 = 2; +pub const SQLITE_VTAB_CONSTRAINT_SUPPORT: i32 = 1; +pub const SQLITE_ROLLBACK: i32 = 1; +pub const SQLITE_FAIL: i32 = 3; +pub const SQLITE_REPLACE: i32 = 5; +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +extern "C" { + #[link_name = "sqlite3_version"] + pub static mut sqlite3_version: [::std::os::raw::c_char; 0usize]; +} +extern "C" { + pub fn sqlite3_libversion() -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_sourceid() -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_libversion_number() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_compileoption_used(zOptName: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_compileoption_get(N: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_threadsafe() -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3([u8; 0]); +pub type sqlite_int64 = ::std::os::raw::c_longlong; +pub type sqlite_uint64 = ::std::os::raw::c_ulonglong; +pub type sqlite3_int64 = sqlite_int64; +pub type sqlite3_uint64 = sqlite_uint64; +extern "C" { + pub fn sqlite3_close(arg1: *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_close_v2(arg1: *mut sqlite3) -> ::std::os::raw::c_int; +} +pub type sqlite3_callback = + ::std::option::Option ::std::os::raw::c_int>; +extern "C" { + pub fn sqlite3_exec(arg1: *mut sqlite3, + sql: *const ::std::os::raw::c_char, + callback: + ::std::option::Option + ::std::os::raw::c_int>, + arg2: *mut ::std::os::raw::c_void, + errmsg: *mut *mut ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_file { + pub pMethods: *const sqlite3_file_sqlite3_io_methods, +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_file_sqlite3_io_methods { + pub iVersion: ::std::os::raw::c_int, + pub xClose: ::std::option::Option ::std::os::raw::c_int>, + pub xRead: ::std::option::Option ::std::os::raw::c_int>, + pub xWrite: ::std::option::Option ::std::os::raw::c_int>, + pub xTruncate: ::std::option::Option ::std::os::raw::c_int>, + pub xSync: ::std::option::Option ::std::os::raw::c_int>, + pub xFileSize: ::std::option::Option ::std::os::raw::c_int>, + pub xLock: ::std::option::Option ::std::os::raw::c_int>, + pub xUnlock: ::std::option::Option ::std::os::raw::c_int>, + pub xCheckReservedLock: ::std::option::Option + ::std::os::raw::c_int>, + pub xFileControl: ::std::option::Option ::std::os::raw::c_int>, + pub xSectorSize: ::std::option::Option ::std::os::raw::c_int>, + pub xDeviceCharacteristics: ::std::option::Option + ::std::os::raw::c_int>, + pub xShmMap: ::std::option::Option ::std::os::raw::c_int>, + pub xShmLock: ::std::option::Option ::std::os::raw::c_int>, + pub xShmBarrier: ::std::option::Option, + pub xShmUnmap: ::std::option::Option ::std::os::raw::c_int>, +} +#[test] +fn bindgen_test_layout_sqlite3_file_sqlite3_io_methods() { + assert_eq!(::std::mem::size_of::() , + 136usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} +impl Clone for sqlite3_file_sqlite3_io_methods { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_sqlite3_file() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_file { + fn clone(&self) -> Self { *self } +} +pub type sqlite3_io_methods = sqlite3_file_sqlite3_io_methods; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_mutex([u8; 0]); +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_vfs { + pub iVersion: ::std::os::raw::c_int, + pub szOsFile: ::std::os::raw::c_int, + pub mxPathname: ::std::os::raw::c_int, + pub pNext: *mut sqlite3_vfs, + pub zName: *const ::std::os::raw::c_char, + pub pAppData: *mut ::std::os::raw::c_void, + pub xOpen: ::std::option::Option ::std::os::raw::c_int>, + pub xDelete: ::std::option::Option ::std::os::raw::c_int>, + pub xAccess: ::std::option::Option ::std::os::raw::c_int>, + pub xFullPathname: ::std::option::Option ::std::os::raw::c_int>, + pub xDlOpen: ::std::option::Option *mut ::std::os::raw::c_void>, + pub xDlError: ::std::option::Option, + pub xDlSym: ::std::option::Option + ::std::option::Option>, + pub xDlClose: ::std::option::Option, + pub xRandomness: ::std::option::Option ::std::os::raw::c_int>, + pub xSleep: ::std::option::Option ::std::os::raw::c_int>, + pub xCurrentTime: ::std::option::Option ::std::os::raw::c_int>, + pub xGetLastError: ::std::option::Option ::std::os::raw::c_int>, + pub xCurrentTimeInt64: ::std::option::Option + ::std::os::raw::c_int>, + pub xSetSystemCall: ::std::option::Option ::std::os::raw::c_int>, + pub xGetSystemCall: ::std::option::Option + ::std::option::Option>, + pub xNextSystemCall: ::std::option::Option + *const ::std::os::raw::c_char>, +} +#[test] +fn bindgen_test_layout_sqlite3_vfs() { + assert_eq!(::std::mem::size_of::() , 168usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_vfs { + fn clone(&self) -> Self { *self } +} +pub type sqlite3_syscall_ptr = ::std::option::Option; +extern "C" { + pub fn sqlite3_initialize() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_shutdown() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_os_init() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_os_end() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_config(arg1: ::std::os::raw::c_int, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_db_config(arg1: *mut sqlite3, + op: ::std::os::raw::c_int, ...) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_mem_methods { + pub xMalloc: ::std::option::Option *mut ::std::os::raw::c_void>, + pub xFree: ::std::option::Option, + pub xRealloc: ::std::option::Option *mut ::std::os::raw::c_void>, + pub xSize: ::std::option::Option ::std::os::raw::c_int>, + pub xRoundup: ::std::option::Option ::std::os::raw::c_int>, + pub xInit: ::std::option::Option ::std::os::raw::c_int>, + pub xShutdown: ::std::option::Option, + pub pAppData: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_sqlite3_mem_methods() { + assert_eq!(::std::mem::size_of::() , 64usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_mem_methods { + fn clone(&self) -> Self { *self } +} +extern "C" { + pub fn sqlite3_extended_result_codes(arg1: *mut sqlite3, + onoff: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_last_insert_rowid(arg1: *mut sqlite3) -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_changes(arg1: *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_total_changes(arg1: *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_interrupt(arg1: *mut sqlite3); +} +extern "C" { + pub fn sqlite3_complete(sql: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_complete16(sql: *const ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_busy_handler(arg1: *mut sqlite3, + arg2: + ::std::option::Option + ::std::os::raw::c_int>, + arg3: *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_busy_timeout(arg1: *mut sqlite3, ms: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_get_table(db: *mut sqlite3, + zSql: *const ::std::os::raw::c_char, + pazResult: *mut *mut *mut ::std::os::raw::c_char, + pnRow: *mut ::std::os::raw::c_int, + pnColumn: *mut ::std::os::raw::c_int, + pzErrmsg: *mut *mut ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_free_table(result: *mut *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn sqlite3_mprintf(arg1: *const ::std::os::raw::c_char, ...) + -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_vmprintf(arg1: *const ::std::os::raw::c_char, + arg2: *mut __va_list_tag) + -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_snprintf(arg1: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, ...) + -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_vsnprintf(arg1: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + arg4: *mut __va_list_tag) + -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_malloc(arg1: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_realloc(arg1: *mut ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_free(arg1: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn sqlite3_memory_used() -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_memory_highwater(resetFlag: ::std::os::raw::c_int) + -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_randomness(N: ::std::os::raw::c_int, + P: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn sqlite3_set_authorizer(arg1: *mut sqlite3, + xAuth: + ::std::option::Option + ::std::os::raw::c_int>, + pUserData: *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_trace(arg1: *mut sqlite3, + xTrace: + ::std::option::Option, + arg2: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_profile(arg1: *mut sqlite3, + xProfile: + ::std::option::Option, + arg2: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_progress_handler(arg1: *mut sqlite3, + arg2: ::std::os::raw::c_int, + arg3: + ::std::option::Option + ::std::os::raw::c_int>, + arg4: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn sqlite3_open(filename: *const ::std::os::raw::c_char, + ppDb: *mut *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_open16(filename: *const ::std::os::raw::c_void, + ppDb: *mut *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_open_v2(filename: *const ::std::os::raw::c_char, + ppDb: *mut *mut sqlite3, + flags: ::std::os::raw::c_int, + zVfs: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_uri_parameter(zFilename: *const ::std::os::raw::c_char, + zParam: *const ::std::os::raw::c_char) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_uri_boolean(zFile: *const ::std::os::raw::c_char, + zParam: *const ::std::os::raw::c_char, + bDefault: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_uri_int64(arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: sqlite3_int64) -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_errcode(db: *mut sqlite3) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_extended_errcode(db: *mut sqlite3) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_errmsg(arg1: *mut sqlite3) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_errmsg16(arg1: *mut sqlite3) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_errstr(arg1: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_stmt([u8; 0]); +extern "C" { + pub fn sqlite3_limit(arg1: *mut sqlite3, id: ::std::os::raw::c_int, + newVal: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_prepare(db: *mut sqlite3, + zSql: *const ::std::os::raw::c_char, + nByte: ::std::os::raw::c_int, + ppStmt: *mut *mut sqlite3_stmt, + pzTail: *mut *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_prepare_v2(db: *mut sqlite3, + zSql: *const ::std::os::raw::c_char, + nByte: ::std::os::raw::c_int, + ppStmt: *mut *mut sqlite3_stmt, + pzTail: *mut *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_prepare16(db: *mut sqlite3, + zSql: *const ::std::os::raw::c_void, + nByte: ::std::os::raw::c_int, + ppStmt: *mut *mut sqlite3_stmt, + pzTail: *mut *const ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_prepare16_v2(db: *mut sqlite3, + zSql: *const ::std::os::raw::c_void, + nByte: ::std::os::raw::c_int, + ppStmt: *mut *mut sqlite3_stmt, + pzTail: *mut *const ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_sql(pStmt: *mut sqlite3_stmt) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_stmt_readonly(pStmt: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_stmt_busy(arg1: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Mem([u8; 0]); +pub type sqlite3_value = Mem; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_context([u8; 0]); +extern "C" { + pub fn sqlite3_bind_blob(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: *const ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + arg4: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_double(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, arg3: f64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_int(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_int64(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: sqlite3_int64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_null(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_text(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: *const ::std::os::raw::c_char, + n: ::std::os::raw::c_int, + arg4: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_text16(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: *const ::std::os::raw::c_void, + arg4: ::std::os::raw::c_int, + arg5: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_value(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + arg3: *const sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_zeroblob(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int, + n: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_parameter_count(arg1: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_bind_parameter_name(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_bind_parameter_index(arg1: *mut sqlite3_stmt, + zName: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_clear_bindings(arg1: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_count(pStmt: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_name(arg1: *mut sqlite3_stmt, + N: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_column_name16(arg1: *mut sqlite3_stmt, + N: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_database_name(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_column_database_name16(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_table_name(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_column_table_name16(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_origin_name(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_column_origin_name16(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_decltype(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_column_decltype16(arg1: *mut sqlite3_stmt, + arg2: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_step(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_data_count(pStmt: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_blob(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_bytes(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_bytes16(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_double(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) -> f64; +} +extern "C" { + pub fn sqlite3_column_int(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_int64(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_column_text(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_uchar; +} +extern "C" { + pub fn sqlite3_column_text16(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_column_type(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_column_value(arg1: *mut sqlite3_stmt, + iCol: ::std::os::raw::c_int) + -> *mut sqlite3_value; +} +extern "C" { + pub fn sqlite3_finalize(pStmt: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_reset(pStmt: *mut sqlite3_stmt) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_function(db: *mut sqlite3, + zFunctionName: + *const ::std::os::raw::c_char, + nArg: ::std::os::raw::c_int, + eTextRep: ::std::os::raw::c_int, + pApp: *mut ::std::os::raw::c_void, + xFunc: + ::std::option::Option, + xStep: + ::std::option::Option, + xFinal: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_function16(db: *mut sqlite3, + zFunctionName: + *const ::std::os::raw::c_void, + nArg: ::std::os::raw::c_int, + eTextRep: ::std::os::raw::c_int, + pApp: *mut ::std::os::raw::c_void, + xFunc: + ::std::option::Option, + xStep: + ::std::option::Option, + xFinal: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_function_v2(db: *mut sqlite3, + zFunctionName: + *const ::std::os::raw::c_char, + nArg: ::std::os::raw::c_int, + eTextRep: ::std::os::raw::c_int, + pApp: *mut ::std::os::raw::c_void, + xFunc: + ::std::option::Option, + xStep: + ::std::option::Option, + xFinal: + ::std::option::Option, + xDestroy: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_aggregate_count(arg1: *mut sqlite3_context) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_expired(arg1: *mut sqlite3_stmt) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_transfer_bindings(arg1: *mut sqlite3_stmt, + arg2: *mut sqlite3_stmt) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_global_recover() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_thread_cleanup(); +} +extern "C" { + pub fn sqlite3_memory_alarm(arg1: + ::std::option::Option, + arg2: *mut ::std::os::raw::c_void, + arg3: sqlite3_int64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_value_blob(arg1: *mut sqlite3_value) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_value_bytes(arg1: *mut sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_value_bytes16(arg1: *mut sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_value_double(arg1: *mut sqlite3_value) -> f64; +} +extern "C" { + pub fn sqlite3_value_int(arg1: *mut sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_value_int64(arg1: *mut sqlite3_value) -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_value_text(arg1: *mut sqlite3_value) + -> *const ::std::os::raw::c_uchar; +} +extern "C" { + pub fn sqlite3_value_text16(arg1: *mut sqlite3_value) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_value_text16le(arg1: *mut sqlite3_value) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_value_text16be(arg1: *mut sqlite3_value) + -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_value_type(arg1: *mut sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_value_numeric_type(arg1: *mut sqlite3_value) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_aggregate_context(arg1: *mut sqlite3_context, + nBytes: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_user_data(arg1: *mut sqlite3_context) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_context_db_handle(arg1: *mut sqlite3_context) + -> *mut sqlite3; +} +extern "C" { + pub fn sqlite3_get_auxdata(arg1: *mut sqlite3_context, + N: ::std::os::raw::c_int) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_set_auxdata(arg1: *mut sqlite3_context, + N: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_void, + arg3: + ::std::option::Option); +} +pub type sqlite3_destructor_type = + ::std::option::Option; +extern "C" { + pub fn sqlite3_result_blob(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int, + arg4: + ::std::option::Option); +} +extern "C" { + pub fn sqlite3_result_double(arg1: *mut sqlite3_context, arg2: f64); +} +extern "C" { + pub fn sqlite3_result_error(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_result_error16(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_result_error_toobig(arg1: *mut sqlite3_context); +} +extern "C" { + pub fn sqlite3_result_error_nomem(arg1: *mut sqlite3_context); +} +extern "C" { + pub fn sqlite3_result_error_code(arg1: *mut sqlite3_context, + arg2: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_result_int(arg1: *mut sqlite3_context, + arg2: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_result_int64(arg1: *mut sqlite3_context, + arg2: sqlite3_int64); +} +extern "C" { + pub fn sqlite3_result_null(arg1: *mut sqlite3_context); +} +extern "C" { + pub fn sqlite3_result_text(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: + ::std::option::Option); +} +extern "C" { + pub fn sqlite3_result_text16(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int, + arg4: + ::std::option::Option); +} +extern "C" { + pub fn sqlite3_result_text16le(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int, + arg4: + ::std::option::Option); +} +extern "C" { + pub fn sqlite3_result_text16be(arg1: *mut sqlite3_context, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int, + arg4: + ::std::option::Option); +} +extern "C" { + pub fn sqlite3_result_value(arg1: *mut sqlite3_context, + arg2: *mut sqlite3_value); +} +extern "C" { + pub fn sqlite3_result_zeroblob(arg1: *mut sqlite3_context, + n: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_create_collation(arg1: *mut sqlite3, + zName: *const ::std::os::raw::c_char, + eTextRep: ::std::os::raw::c_int, + pArg: *mut ::std::os::raw::c_void, + xCompare: + ::std::option::Option + ::std::os::raw::c_int>) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_collation_v2(arg1: *mut sqlite3, + zName: *const ::std::os::raw::c_char, + eTextRep: ::std::os::raw::c_int, + pArg: *mut ::std::os::raw::c_void, + xCompare: + ::std::option::Option + ::std::os::raw::c_int>, + xDestroy: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_collation16(arg1: *mut sqlite3, + zName: *const ::std::os::raw::c_void, + eTextRep: ::std::os::raw::c_int, + pArg: *mut ::std::os::raw::c_void, + xCompare: + ::std::option::Option + ::std::os::raw::c_int>) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_collation_needed(arg1: *mut sqlite3, + arg2: *mut ::std::os::raw::c_void, + arg3: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_collation_needed16(arg1: *mut sqlite3, + arg2: *mut ::std::os::raw::c_void, + arg3: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_sleep(arg1: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "sqlite3_temp_directory"] + pub static mut sqlite3_temp_directory: *mut ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "sqlite3_data_directory"] + pub static mut sqlite3_data_directory: *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_get_autocommit(arg1: *mut sqlite3) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_db_handle(arg1: *mut sqlite3_stmt) -> *mut sqlite3; +} +extern "C" { + pub fn sqlite3_db_filename(db: *mut sqlite3, + zDbName: *const ::std::os::raw::c_char) + -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn sqlite3_db_readonly(db: *mut sqlite3, + zDbName: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_next_stmt(pDb: *mut sqlite3, pStmt: *mut sqlite3_stmt) + -> *mut sqlite3_stmt; +} +extern "C" { + pub fn sqlite3_commit_hook(arg1: *mut sqlite3, + arg2: + ::std::option::Option + ::std::os::raw::c_int>, + arg3: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_rollback_hook(arg1: *mut sqlite3, + arg2: + ::std::option::Option, + arg3: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_update_hook(arg1: *mut sqlite3, + arg2: + ::std::option::Option, + arg3: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_enable_shared_cache(arg1: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_release_memory(arg1: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_db_release_memory(arg1: *mut sqlite3) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_soft_heap_limit64(N: sqlite3_int64) -> sqlite3_int64; +} +extern "C" { + pub fn sqlite3_soft_heap_limit(N: ::std::os::raw::c_int); +} +extern "C" { + pub fn sqlite3_table_column_metadata(db: *mut sqlite3, + zDbName: + *const ::std::os::raw::c_char, + zTableName: + *const ::std::os::raw::c_char, + zColumnName: + *const ::std::os::raw::c_char, + pzDataType: + *mut *const ::std::os::raw::c_char, + pzCollSeq: + *mut *const ::std::os::raw::c_char, + pNotNull: *mut ::std::os::raw::c_int, + pPrimaryKey: + *mut ::std::os::raw::c_int, + pAutoinc: *mut ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_load_extension(db: *mut sqlite3, + zFile: *const ::std::os::raw::c_char, + zProc: *const ::std::os::raw::c_char, + pzErrMsg: *mut *mut ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_enable_load_extension(db: *mut sqlite3, + onoff: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_auto_extension(xEntryPoint: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_reset_auto_extension(); +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_vtab { + pub pModule: *const sqlite3_module, + pub nRef: ::std::os::raw::c_int, + pub zErrMsg: *mut ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_sqlite3_vtab() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_vtab { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_index_info { + pub nConstraint: ::std::os::raw::c_int, + pub aConstraint: *mut sqlite3_index_info_sqlite3_index_constraint, + pub nOrderBy: ::std::os::raw::c_int, + pub aOrderBy: *mut sqlite3_index_info_sqlite3_index_orderby, + pub aConstraintUsage: *mut sqlite3_index_info_sqlite3_index_constraint_usage, + pub idxNum: ::std::os::raw::c_int, + pub idxStr: *mut ::std::os::raw::c_char, + pub needToFreeIdxStr: ::std::os::raw::c_int, + pub orderByConsumed: ::std::os::raw::c_int, + pub estimatedCost: f64, +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_index_info_sqlite3_index_constraint { + pub iColumn: ::std::os::raw::c_int, + pub op: ::std::os::raw::c_uchar, + pub usable: ::std::os::raw::c_uchar, + pub iTermOffset: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_sqlite3_index_info_sqlite3_index_constraint() { + assert_eq!(::std::mem::size_of::() + , 12usize); + assert_eq!(::std::mem::align_of::() + , 4usize); +} +impl Clone for sqlite3_index_info_sqlite3_index_constraint { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_index_info_sqlite3_index_orderby { + pub iColumn: ::std::os::raw::c_int, + pub desc: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_sqlite3_index_info_sqlite3_index_orderby() { + assert_eq!(::std::mem::size_of::() + , 8usize); + assert_eq!(::std::mem::align_of::() + , 4usize); +} +impl Clone for sqlite3_index_info_sqlite3_index_orderby { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_index_info_sqlite3_index_constraint_usage { + pub argvIndex: ::std::os::raw::c_int, + pub omit: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_sqlite3_index_info_sqlite3_index_constraint_usage() { + assert_eq!(::std::mem::size_of::() + , 8usize); + assert_eq!(::std::mem::align_of::() + , 4usize); +} +impl Clone for sqlite3_index_info_sqlite3_index_constraint_usage { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_sqlite3_index_info() { + assert_eq!(::std::mem::size_of::() , 72usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_index_info { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_vtab_cursor { + pub pVtab: *mut sqlite3_vtab, +} +#[test] +fn bindgen_test_layout_sqlite3_vtab_cursor() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_vtab_cursor { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_module { + pub iVersion: ::std::os::raw::c_int, + pub xCreate: ::std::option::Option ::std::os::raw::c_int>, + pub xConnect: ::std::option::Option ::std::os::raw::c_int>, + pub xBestIndex: ::std::option::Option ::std::os::raw::c_int>, + pub xDisconnect: ::std::option::Option ::std::os::raw::c_int>, + pub xDestroy: ::std::option::Option ::std::os::raw::c_int>, + pub xOpen: ::std::option::Option ::std::os::raw::c_int>, + pub xClose: ::std::option::Option ::std::os::raw::c_int>, + pub xFilter: ::std::option::Option ::std::os::raw::c_int>, + pub xNext: ::std::option::Option ::std::os::raw::c_int>, + pub xEof: ::std::option::Option ::std::os::raw::c_int>, + pub xColumn: ::std::option::Option ::std::os::raw::c_int>, + pub xRowid: ::std::option::Option ::std::os::raw::c_int>, + pub xUpdate: ::std::option::Option ::std::os::raw::c_int>, + pub xBegin: ::std::option::Option ::std::os::raw::c_int>, + pub xSync: ::std::option::Option ::std::os::raw::c_int>, + pub xCommit: ::std::option::Option ::std::os::raw::c_int>, + pub xRollback: ::std::option::Option ::std::os::raw::c_int>, + pub xFindFunction: ::std::option::Option, + ppArg: + *mut *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int>, + pub xRename: ::std::option::Option ::std::os::raw::c_int>, + pub xSavepoint: ::std::option::Option ::std::os::raw::c_int>, + pub xRelease: ::std::option::Option ::std::os::raw::c_int>, + pub xRollbackTo: ::std::option::Option ::std::os::raw::c_int>, +} +#[test] +fn bindgen_test_layout_sqlite3_module() { + assert_eq!(::std::mem::size_of::() , 184usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_module { + fn clone(&self) -> Self { *self } +} +extern "C" { + pub fn sqlite3_create_module(db: *mut sqlite3, + zName: *const ::std::os::raw::c_char, + p: *const sqlite3_module, + pClientData: *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_create_module_v2(db: *mut sqlite3, + zName: *const ::std::os::raw::c_char, + p: *const sqlite3_module, + pClientData: *mut ::std::os::raw::c_void, + xDestroy: + ::std::option::Option) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_declare_vtab(arg1: *mut sqlite3, + zSQL: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_overload_function(arg1: *mut sqlite3, + zFuncName: *const ::std::os::raw::c_char, + nArg: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_blob([u8; 0]); +extern "C" { + pub fn sqlite3_blob_open(arg1: *mut sqlite3, + zDb: *const ::std::os::raw::c_char, + zTable: *const ::std::os::raw::c_char, + zColumn: *const ::std::os::raw::c_char, + iRow: sqlite3_int64, + flags: ::std::os::raw::c_int, + ppBlob: *mut *mut sqlite3_blob) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_blob_reopen(arg1: *mut sqlite3_blob, arg2: sqlite3_int64) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_blob_close(arg1: *mut sqlite3_blob) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_blob_bytes(arg1: *mut sqlite3_blob) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_blob_read(arg1: *mut sqlite3_blob, + Z: *mut ::std::os::raw::c_void, + N: ::std::os::raw::c_int, + iOffset: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_blob_write(arg1: *mut sqlite3_blob, + z: *const ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + iOffset: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_vfs_find(zVfsName: *const ::std::os::raw::c_char) + -> *mut sqlite3_vfs; +} +extern "C" { + pub fn sqlite3_vfs_register(arg1: *mut sqlite3_vfs, + makeDflt: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_vfs_unregister(arg1: *mut sqlite3_vfs) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_mutex_alloc(arg1: ::std::os::raw::c_int) + -> *mut sqlite3_mutex; +} +extern "C" { + pub fn sqlite3_mutex_free(arg1: *mut sqlite3_mutex); +} +extern "C" { + pub fn sqlite3_mutex_enter(arg1: *mut sqlite3_mutex); +} +extern "C" { + pub fn sqlite3_mutex_try(arg1: *mut sqlite3_mutex) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_mutex_leave(arg1: *mut sqlite3_mutex); +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_mutex_methods { + pub xMutexInit: ::std::option::Option ::std::os::raw::c_int>, + pub xMutexEnd: ::std::option::Option ::std::os::raw::c_int>, + pub xMutexAlloc: ::std::option::Option *mut sqlite3_mutex>, + pub xMutexFree: ::std::option::Option, + pub xMutexEnter: ::std::option::Option, + pub xMutexTry: ::std::option::Option ::std::os::raw::c_int>, + pub xMutexLeave: ::std::option::Option, + pub xMutexHeld: ::std::option::Option ::std::os::raw::c_int>, + pub xMutexNotheld: ::std::option::Option ::std::os::raw::c_int>, +} +#[test] +fn bindgen_test_layout_sqlite3_mutex_methods() { + assert_eq!(::std::mem::size_of::() , 72usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_mutex_methods { + fn clone(&self) -> Self { *self } +} +extern "C" { + pub fn sqlite3_mutex_held(arg1: *mut sqlite3_mutex) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_mutex_notheld(arg1: *mut sqlite3_mutex) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_db_mutex(arg1: *mut sqlite3) -> *mut sqlite3_mutex; +} +extern "C" { + pub fn sqlite3_file_control(arg1: *mut sqlite3, + zDbName: *const ::std::os::raw::c_char, + op: ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_test_control(op: ::std::os::raw::c_int, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_status(op: ::std::os::raw::c_int, + pCurrent: *mut ::std::os::raw::c_int, + pHighwater: *mut ::std::os::raw::c_int, + resetFlag: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_db_status(arg1: *mut sqlite3, op: ::std::os::raw::c_int, + pCur: *mut ::std::os::raw::c_int, + pHiwtr: *mut ::std::os::raw::c_int, + resetFlg: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_stmt_status(arg1: *mut sqlite3_stmt, + op: ::std::os::raw::c_int, + resetFlg: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_pcache([u8; 0]); +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_pcache_page { + pub pBuf: *mut ::std::os::raw::c_void, + pub pExtra: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_sqlite3_pcache_page() { + assert_eq!(::std::mem::size_of::() , 16usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_pcache_page { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_pcache_methods2 { + pub iVersion: ::std::os::raw::c_int, + pub pArg: *mut ::std::os::raw::c_void, + pub xInit: ::std::option::Option ::std::os::raw::c_int>, + pub xShutdown: ::std::option::Option, + pub xCreate: ::std::option::Option *mut sqlite3_pcache>, + pub xCachesize: ::std::option::Option, + pub xPagecount: ::std::option::Option ::std::os::raw::c_int>, + pub xFetch: ::std::option::Option *mut sqlite3_pcache_page>, + pub xUnpin: ::std::option::Option, + pub xRekey: ::std::option::Option, + pub xTruncate: ::std::option::Option, + pub xDestroy: ::std::option::Option, + pub xShrink: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_sqlite3_pcache_methods2() { + assert_eq!(::std::mem::size_of::() , 104usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_pcache_methods2 { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_pcache_methods { + pub pArg: *mut ::std::os::raw::c_void, + pub xInit: ::std::option::Option ::std::os::raw::c_int>, + pub xShutdown: ::std::option::Option, + pub xCreate: ::std::option::Option *mut sqlite3_pcache>, + pub xCachesize: ::std::option::Option, + pub xPagecount: ::std::option::Option ::std::os::raw::c_int>, + pub xFetch: ::std::option::Option *mut ::std::os::raw::c_void>, + pub xUnpin: ::std::option::Option, + pub xRekey: ::std::option::Option, + pub xTruncate: ::std::option::Option, + pub xDestroy: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_sqlite3_pcache_methods() { + assert_eq!(::std::mem::size_of::() , 88usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_pcache_methods { + fn clone(&self) -> Self { *self } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sqlite3_backup([u8; 0]); +extern "C" { + pub fn sqlite3_backup_init(pDest: *mut sqlite3, + zDestName: *const ::std::os::raw::c_char, + pSource: *mut sqlite3, + zSourceName: *const ::std::os::raw::c_char) + -> *mut sqlite3_backup; +} +extern "C" { + pub fn sqlite3_backup_step(p: *mut sqlite3_backup, + nPage: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_backup_finish(p: *mut sqlite3_backup) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_backup_remaining(p: *mut sqlite3_backup) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_backup_pagecount(p: *mut sqlite3_backup) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_unlock_notify(pBlocked: *mut sqlite3, + xNotify: + ::std::option::Option, + pNotifyArg: *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_stricmp(arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_strnicmp(arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_log(iErrCode: ::std::os::raw::c_int, + zFormat: *const ::std::os::raw::c_char, ...); +} +extern "C" { + pub fn sqlite3_wal_hook(arg1: *mut sqlite3, + arg2: + ::std::option::Option + ::std::os::raw::c_int>, + arg3: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sqlite3_wal_autocheckpoint(db: *mut sqlite3, + N: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_wal_checkpoint(db: *mut sqlite3, + zDb: *const ::std::os::raw::c_char) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_wal_checkpoint_v2(db: *mut sqlite3, + zDb: *const ::std::os::raw::c_char, + eMode: ::std::os::raw::c_int, + pnLog: *mut ::std::os::raw::c_int, + pnCkpt: *mut ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_vtab_config(arg1: *mut sqlite3, + op: ::std::os::raw::c_int, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sqlite3_vtab_on_conflict(arg1: *mut sqlite3) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct sqlite3_rtree_geometry { + pub pContext: *mut ::std::os::raw::c_void, + pub nParam: ::std::os::raw::c_int, + pub aParam: *mut f64, + pub pUser: *mut ::std::os::raw::c_void, + pub xDelUser: ::std::option::Option, +} +#[test] +fn bindgen_test_layout_sqlite3_rtree_geometry() { + assert_eq!(::std::mem::size_of::() , 40usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +impl Clone for sqlite3_rtree_geometry { + fn clone(&self) -> Self { *self } +} +extern "C" { + pub fn sqlite3_rtree_geometry_callback(db: *mut sqlite3, + zGeom: + *const ::std::os::raw::c_char, + xGeom: + ::std::option::Option + ::std::os::raw::c_int>, + pContext: + *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} +impl Clone for __va_list_tag { + fn clone(&self) -> Self { *self } +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; + +pub const SQLITE_DETERMINISTIC: i32 = 2048; diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs index 8b4aa42..4d622a0 100644 --- a/libsqlite3-sys/build.rs +++ b/libsqlite3-sys/build.rs @@ -125,6 +125,9 @@ mod build { #[cfg(feature = "min_sqlite_version_3_7_7")] "bindgen-bindings/bindgen_3.7.7.rs", + + #[cfg(feature = "min_sqlite_version_3_7_16")] + "bindgen-bindings/bindgen_3.7.16.rs", ]; pub fn write_to_out_dir(_header: HeaderLocation) { diff --git a/libsqlite3-sys/src/error.rs b/libsqlite3-sys/src/error.rs index 855cef2..9394e5f 100644 --- a/libsqlite3-sys/src/error.rs +++ b/libsqlite3-sys/src/error.rs @@ -110,95 +110,98 @@ impl error::Error for Error { } // Result codes. +// Note: These are not public because our bindgen bindings export whichever constants are present +// in the current version of SQLite. We repeat them here so we don't have to worry about which +// version of SQLite added which constants, and we only use them to implement code_to_str below. -pub const SQLITE_OK : c_int = 0; -pub const SQLITE_ERROR : c_int = 1; -pub const SQLITE_INTERNAL : c_int = 2; -pub const SQLITE_PERM : c_int = 3; -pub const SQLITE_ABORT : c_int = 4; -pub const SQLITE_BUSY : c_int = 5; -pub const SQLITE_LOCKED : c_int = 6; -pub const SQLITE_NOMEM : c_int = 7; -pub const SQLITE_READONLY : c_int = 8; -pub const SQLITE_INTERRUPT : c_int = 9; -pub const SQLITE_IOERR : c_int = 10; -pub const SQLITE_CORRUPT : c_int = 11; -pub const SQLITE_NOTFOUND : c_int = 12; -pub const SQLITE_FULL : c_int = 13; -pub const SQLITE_CANTOPEN : c_int = 14; -pub const SQLITE_PROTOCOL : c_int = 15; -pub const SQLITE_EMPTY : c_int = 16; -pub const SQLITE_SCHEMA : c_int = 17; -pub const SQLITE_TOOBIG : c_int = 18; -pub const SQLITE_CONSTRAINT: c_int = 19; -pub const SQLITE_MISMATCH : c_int = 20; -pub const SQLITE_MISUSE : c_int = 21; -pub const SQLITE_NOLFS : c_int = 22; -pub const SQLITE_AUTH : c_int = 23; -pub const SQLITE_FORMAT : c_int = 24; -pub const SQLITE_RANGE : c_int = 25; -pub const SQLITE_NOTADB : c_int = 26; -pub const SQLITE_NOTICE : c_int = 27; -pub const SQLITE_WARNING : c_int = 28; -pub const SQLITE_ROW : c_int = 100; -pub const SQLITE_DONE : c_int = 101; +const SQLITE_OK : c_int = 0; +const SQLITE_ERROR : c_int = 1; +const SQLITE_INTERNAL : c_int = 2; +const SQLITE_PERM : c_int = 3; +const SQLITE_ABORT : c_int = 4; +const SQLITE_BUSY : c_int = 5; +const SQLITE_LOCKED : c_int = 6; +const SQLITE_NOMEM : c_int = 7; +const SQLITE_READONLY : c_int = 8; +const SQLITE_INTERRUPT : c_int = 9; +const SQLITE_IOERR : c_int = 10; +const SQLITE_CORRUPT : c_int = 11; +const SQLITE_NOTFOUND : c_int = 12; +const SQLITE_FULL : c_int = 13; +const SQLITE_CANTOPEN : c_int = 14; +const SQLITE_PROTOCOL : c_int = 15; +const SQLITE_EMPTY : c_int = 16; +const SQLITE_SCHEMA : c_int = 17; +const SQLITE_TOOBIG : c_int = 18; +const SQLITE_CONSTRAINT: c_int = 19; +const SQLITE_MISMATCH : c_int = 20; +const SQLITE_MISUSE : c_int = 21; +const SQLITE_NOLFS : c_int = 22; +const SQLITE_AUTH : c_int = 23; +const SQLITE_FORMAT : c_int = 24; +const SQLITE_RANGE : c_int = 25; +const SQLITE_NOTADB : c_int = 26; +const SQLITE_NOTICE : c_int = 27; +const SQLITE_WARNING : c_int = 28; +const SQLITE_ROW : c_int = 100; +const SQLITE_DONE : c_int = 101; // Extended result codes. -pub const SQLITE_IOERR_READ : c_int = (SQLITE_IOERR | (1<<8)); -pub const SQLITE_IOERR_SHORT_READ : c_int = (SQLITE_IOERR | (2<<8)); -pub const SQLITE_IOERR_WRITE : c_int = (SQLITE_IOERR | (3<<8)); -pub const SQLITE_IOERR_FSYNC : c_int = (SQLITE_IOERR | (4<<8)); -pub const SQLITE_IOERR_DIR_FSYNC : c_int = (SQLITE_IOERR | (5<<8)); -pub const SQLITE_IOERR_TRUNCATE : c_int = (SQLITE_IOERR | (6<<8)); -pub const SQLITE_IOERR_FSTAT : c_int = (SQLITE_IOERR | (7<<8)); -pub const SQLITE_IOERR_UNLOCK : c_int = (SQLITE_IOERR | (8<<8)); -pub const SQLITE_IOERR_RDLOCK : c_int = (SQLITE_IOERR | (9<<8)); -pub const SQLITE_IOERR_DELETE : c_int = (SQLITE_IOERR | (10<<8)); -pub const SQLITE_IOERR_BLOCKED : c_int = (SQLITE_IOERR | (11<<8)); -pub const SQLITE_IOERR_NOMEM : c_int = (SQLITE_IOERR | (12<<8)); -pub const SQLITE_IOERR_ACCESS : c_int = (SQLITE_IOERR | (13<<8)); -pub const SQLITE_IOERR_CHECKRESERVEDLOCK : c_int = (SQLITE_IOERR | (14<<8)); -pub const SQLITE_IOERR_LOCK : c_int = (SQLITE_IOERR | (15<<8)); -pub const SQLITE_IOERR_CLOSE : c_int = (SQLITE_IOERR | (16<<8)); -pub const SQLITE_IOERR_DIR_CLOSE : c_int = (SQLITE_IOERR | (17<<8)); -pub const SQLITE_IOERR_SHMOPEN : c_int = (SQLITE_IOERR | (18<<8)); -pub const SQLITE_IOERR_SHMSIZE : c_int = (SQLITE_IOERR | (19<<8)); -pub const SQLITE_IOERR_SHMLOCK : c_int = (SQLITE_IOERR | (20<<8)); -pub const SQLITE_IOERR_SHMMAP : c_int = (SQLITE_IOERR | (21<<8)); -pub const SQLITE_IOERR_SEEK : c_int = (SQLITE_IOERR | (22<<8)); -pub const SQLITE_IOERR_DELETE_NOENT : c_int = (SQLITE_IOERR | (23<<8)); -pub const SQLITE_IOERR_MMAP : c_int = (SQLITE_IOERR | (24<<8)); -pub const SQLITE_IOERR_GETTEMPPATH : c_int = (SQLITE_IOERR | (25<<8)); -pub const SQLITE_IOERR_CONVPATH : c_int = (SQLITE_IOERR | (26<<8)); -pub const SQLITE_IOERR_VNODE : c_int = (SQLITE_IOERR | (27<<8)); -pub const SQLITE_LOCKED_SHAREDCACHE : c_int = (SQLITE_LOCKED | (1<<8)); -pub const SQLITE_BUSY_RECOVERY : c_int = (SQLITE_BUSY | (1<<8)); -pub const SQLITE_BUSY_SNAPSHOT : c_int = (SQLITE_BUSY | (2<<8)); -pub const SQLITE_CANTOPEN_NOTEMPDIR : c_int = (SQLITE_CANTOPEN | (1<<8)); -pub const SQLITE_CANTOPEN_ISDIR : c_int = (SQLITE_CANTOPEN | (2<<8)); -pub const SQLITE_CANTOPEN_FULLPATH : c_int = (SQLITE_CANTOPEN | (3<<8)); -pub const SQLITE_CANTOPEN_CONVPATH : c_int = (SQLITE_CANTOPEN | (4<<8)); -pub const SQLITE_CORRUPT_VTAB : c_int = (SQLITE_CORRUPT | (1<<8)); -pub const SQLITE_READONLY_RECOVERY : c_int = (SQLITE_READONLY | (1<<8)); -pub const SQLITE_READONLY_CANTLOCK : c_int = (SQLITE_READONLY | (2<<8)); -pub const SQLITE_READONLY_ROLLBACK : c_int = (SQLITE_READONLY | (3<<8)); -pub const SQLITE_READONLY_DBMOVED : c_int = (SQLITE_READONLY | (4<<8)); -pub const SQLITE_ABORT_ROLLBACK : c_int = (SQLITE_ABORT | (2<<8)); -pub const SQLITE_CONSTRAINT_CHECK : c_int = (SQLITE_CONSTRAINT | (1<<8)); -pub const SQLITE_CONSTRAINT_COMMITHOOK : c_int = (SQLITE_CONSTRAINT | (2<<8)); -pub const SQLITE_CONSTRAINT_FOREIGNKEY : c_int = (SQLITE_CONSTRAINT | (3<<8)); -pub const SQLITE_CONSTRAINT_FUNCTION : c_int = (SQLITE_CONSTRAINT | (4<<8)); -pub const SQLITE_CONSTRAINT_NOTNULL : c_int = (SQLITE_CONSTRAINT | (5<<8)); -pub const SQLITE_CONSTRAINT_PRIMARYKEY : c_int = (SQLITE_CONSTRAINT | (6<<8)); -pub const SQLITE_CONSTRAINT_TRIGGER : c_int = (SQLITE_CONSTRAINT | (7<<8)); -pub const SQLITE_CONSTRAINT_UNIQUE : c_int = (SQLITE_CONSTRAINT | (8<<8)); -pub const SQLITE_CONSTRAINT_VTAB : c_int = (SQLITE_CONSTRAINT | (9<<8)); -pub const SQLITE_CONSTRAINT_ROWID : c_int = (SQLITE_CONSTRAINT |(10<<8)); -pub const SQLITE_NOTICE_RECOVER_WAL : c_int = (SQLITE_NOTICE | (1<<8)); -pub const SQLITE_NOTICE_RECOVER_ROLLBACK : c_int = (SQLITE_NOTICE | (2<<8)); -pub const SQLITE_WARNING_AUTOINDEX : c_int = (SQLITE_WARNING | (1<<8)); -pub const SQLITE_AUTH_USER : c_int = (SQLITE_AUTH | (1<<8)); +const SQLITE_IOERR_READ : c_int = (SQLITE_IOERR | (1<<8)); +const SQLITE_IOERR_SHORT_READ : c_int = (SQLITE_IOERR | (2<<8)); +const SQLITE_IOERR_WRITE : c_int = (SQLITE_IOERR | (3<<8)); +const SQLITE_IOERR_FSYNC : c_int = (SQLITE_IOERR | (4<<8)); +const SQLITE_IOERR_DIR_FSYNC : c_int = (SQLITE_IOERR | (5<<8)); +const SQLITE_IOERR_TRUNCATE : c_int = (SQLITE_IOERR | (6<<8)); +const SQLITE_IOERR_FSTAT : c_int = (SQLITE_IOERR | (7<<8)); +const SQLITE_IOERR_UNLOCK : c_int = (SQLITE_IOERR | (8<<8)); +const SQLITE_IOERR_RDLOCK : c_int = (SQLITE_IOERR | (9<<8)); +const SQLITE_IOERR_DELETE : c_int = (SQLITE_IOERR | (10<<8)); +const SQLITE_IOERR_BLOCKED : c_int = (SQLITE_IOERR | (11<<8)); +const SQLITE_IOERR_NOMEM : c_int = (SQLITE_IOERR | (12<<8)); +const SQLITE_IOERR_ACCESS : c_int = (SQLITE_IOERR | (13<<8)); +const SQLITE_IOERR_CHECKRESERVEDLOCK : c_int = (SQLITE_IOERR | (14<<8)); +const SQLITE_IOERR_LOCK : c_int = (SQLITE_IOERR | (15<<8)); +const SQLITE_IOERR_CLOSE : c_int = (SQLITE_IOERR | (16<<8)); +const SQLITE_IOERR_DIR_CLOSE : c_int = (SQLITE_IOERR | (17<<8)); +const SQLITE_IOERR_SHMOPEN : c_int = (SQLITE_IOERR | (18<<8)); +const SQLITE_IOERR_SHMSIZE : c_int = (SQLITE_IOERR | (19<<8)); +const SQLITE_IOERR_SHMLOCK : c_int = (SQLITE_IOERR | (20<<8)); +const SQLITE_IOERR_SHMMAP : c_int = (SQLITE_IOERR | (21<<8)); +const SQLITE_IOERR_SEEK : c_int = (SQLITE_IOERR | (22<<8)); +const SQLITE_IOERR_DELETE_NOENT : c_int = (SQLITE_IOERR | (23<<8)); +const SQLITE_IOERR_MMAP : c_int = (SQLITE_IOERR | (24<<8)); +const SQLITE_IOERR_GETTEMPPATH : c_int = (SQLITE_IOERR | (25<<8)); +const SQLITE_IOERR_CONVPATH : c_int = (SQLITE_IOERR | (26<<8)); +const SQLITE_IOERR_VNODE : c_int = (SQLITE_IOERR | (27<<8)); +const SQLITE_LOCKED_SHAREDCACHE : c_int = (SQLITE_LOCKED | (1<<8)); +const SQLITE_BUSY_RECOVERY : c_int = (SQLITE_BUSY | (1<<8)); +const SQLITE_BUSY_SNAPSHOT : c_int = (SQLITE_BUSY | (2<<8)); +const SQLITE_CANTOPEN_NOTEMPDIR : c_int = (SQLITE_CANTOPEN | (1<<8)); +const SQLITE_CANTOPEN_ISDIR : c_int = (SQLITE_CANTOPEN | (2<<8)); +const SQLITE_CANTOPEN_FULLPATH : c_int = (SQLITE_CANTOPEN | (3<<8)); +const SQLITE_CANTOPEN_CONVPATH : c_int = (SQLITE_CANTOPEN | (4<<8)); +const SQLITE_CORRUPT_VTAB : c_int = (SQLITE_CORRUPT | (1<<8)); +const SQLITE_READONLY_RECOVERY : c_int = (SQLITE_READONLY | (1<<8)); +const SQLITE_READONLY_CANTLOCK : c_int = (SQLITE_READONLY | (2<<8)); +const SQLITE_READONLY_ROLLBACK : c_int = (SQLITE_READONLY | (3<<8)); +const SQLITE_READONLY_DBMOVED : c_int = (SQLITE_READONLY | (4<<8)); +const SQLITE_ABORT_ROLLBACK : c_int = (SQLITE_ABORT | (2<<8)); +const SQLITE_CONSTRAINT_CHECK : c_int = (SQLITE_CONSTRAINT | (1<<8)); +const SQLITE_CONSTRAINT_COMMITHOOK : c_int = (SQLITE_CONSTRAINT | (2<<8)); +const SQLITE_CONSTRAINT_FOREIGNKEY : c_int = (SQLITE_CONSTRAINT | (3<<8)); +const SQLITE_CONSTRAINT_FUNCTION : c_int = (SQLITE_CONSTRAINT | (4<<8)); +const SQLITE_CONSTRAINT_NOTNULL : c_int = (SQLITE_CONSTRAINT | (5<<8)); +const SQLITE_CONSTRAINT_PRIMARYKEY : c_int = (SQLITE_CONSTRAINT | (6<<8)); +const SQLITE_CONSTRAINT_TRIGGER : c_int = (SQLITE_CONSTRAINT | (7<<8)); +const SQLITE_CONSTRAINT_UNIQUE : c_int = (SQLITE_CONSTRAINT | (8<<8)); +const SQLITE_CONSTRAINT_VTAB : c_int = (SQLITE_CONSTRAINT | (9<<8)); +const SQLITE_CONSTRAINT_ROWID : c_int = (SQLITE_CONSTRAINT |(10<<8)); +const SQLITE_NOTICE_RECOVER_WAL : c_int = (SQLITE_NOTICE | (1<<8)); +const SQLITE_NOTICE_RECOVER_ROLLBACK : c_int = (SQLITE_NOTICE | (2<<8)); +const SQLITE_WARNING_AUTOINDEX : c_int = (SQLITE_WARNING | (1<<8)); +const SQLITE_AUTH_USER : c_int = (SQLITE_AUTH | (1<<8)); pub fn code_to_str(code: c_int) -> &'static str { match code { diff --git a/src/functions.rs b/src/functions.rs index f83222d..8829091 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -114,6 +114,15 @@ pub fn set_result<'a>(ctx: *mut sqlite3_context, result: &ToSqlOutput<'a>) { } pub unsafe fn report_error(ctx: *mut sqlite3_context, err: &Error) { + // Extended constraint error codes were added in SQLite 3.7.16. We don't have an explicit + // feature check for that, and this doesn't really warrant one. We'll use the extended code + // if we're on the bundled version (since it's at least 3.17.0) and the normal constraint + // error code if not. + #[cfg(feature = "bundled")] + fn constraint_error_code() -> i32 { ffi::SQLITE_CONSTRAINT_FUNCTION } + #[cfg(not(feature = "bundled"))] + fn constraint_error_code() -> i32 { ffi::SQLITE_CONSTRAINT } + match *err { Error::SqliteFailure(ref err, ref s) => { ffi::sqlite3_result_error_code(ctx, err.extended_code); @@ -122,7 +131,7 @@ pub unsafe fn report_error(ctx: *mut sqlite3_context, err: &Error) { } } _ => { - ffi::sqlite3_result_error_code(ctx, ffi::SQLITE_CONSTRAINT_FUNCTION); + ffi::sqlite3_result_error_code(ctx, constraint_error_code()); if let Ok(cstr) = str_to_cstring(err.description()) { ffi::sqlite3_result_error(ctx, cstr.as_ptr(), -1); } diff --git a/src/lib.rs b/src/lib.rs index 95db3a2..7f8e8c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ extern crate libsqlite3_sys as ffi; extern crate lru_cache; #[macro_use] extern crate bitflags; -#[cfg(test)] +#[cfg(all(test, feature = "trace"))] #[macro_use] extern crate lazy_static; @@ -1171,6 +1171,15 @@ mod test { #[test] fn test_notnull_constraint_error() { + // extended error codes for constraints were added in SQLite 3.7.16; if we're + // running on our bundled version, we know the extended error code exists. + #[cfg(feature = "bundled")] + fn check_extended_code(extended_code: c_int) { + assert_eq!(extended_code, ffi::SQLITE_CONSTRAINT_NOTNULL); + } + #[cfg(not(feature = "bundled"))] + fn check_extended_code(_extended_code: c_int) {} + let db = checked_memory_handle(); db.execute_batch("CREATE TABLE foo(x NOT NULL)").unwrap(); @@ -1180,12 +1189,7 @@ mod test { match result.unwrap_err() { Error::SqliteFailure(err, _) => { assert_eq!(err.code, ErrorCode::ConstraintViolation); - - // extended error codes for constraints were added in SQLite 3.7.16; if we're - // running on a version at least that new, check for the extended code - if version_number() >= 3007016 { - assert_eq!(err.extended_code, ffi::SQLITE_CONSTRAINT_NOTNULL) - } + check_extended_code(err.extended_code); } err => panic!("Unexpected error {}", err), } diff --git a/src/types/from_sql.rs b/src/types/from_sql.rs index 415ff27..ab79750 100644 --- a/src/types/from_sql.rs +++ b/src/types/from_sql.rs @@ -49,6 +49,14 @@ impl Error for FromSqlError { pub type FromSqlResult = Result; /// A trait for types that can be created from a SQLite value. +/// +/// Note that `FromSql` and `ToSql` are defined for most integral types, but not `u64` or `usize`. +/// This is intentional; SQLite returns integers as signed 64-bit values, which cannot fully +/// represent the range of these types. Rusqlite would have to decide how to handle negative +/// values: return an error or reinterpret as a very large postive numbers, neither of which is +/// guaranteed to be correct for everyone. Callers can work around this by fetching values as i64 +/// and then doing the interpretation themselves or by defining a newtype and implementing +/// `FromSql`/`ToSql` for it. pub trait FromSql: Sized { fn column_result(value: ValueRef) -> FromSqlResult; } @@ -72,6 +80,7 @@ macro_rules! from_sql_integral( from_sql_integral!(i8); from_sql_integral!(i16); from_sql_integral!(i32); +from_sql_integral!(isize); from_sql_integral!(u8); from_sql_integral!(u16); from_sql_integral!(u32); diff --git a/src/types/to_sql.rs b/src/types/to_sql.rs index 0e4d754..3d4df7f 100644 --- a/src/types/to_sql.rs +++ b/src/types/to_sql.rs @@ -74,6 +74,7 @@ to_sql_self!(i8); to_sql_self!(i16); to_sql_self!(i32); to_sql_self!(i64); +to_sql_self!(isize); to_sql_self!(u8); to_sql_self!(u16); to_sql_self!(u32); diff --git a/src/types/value.rs b/src/types/value.rs index e192826..65dfc94 100644 --- a/src/types/value.rs +++ b/src/types/value.rs @@ -43,6 +43,7 @@ macro_rules! from_i64( from_i64!(i8); from_i64!(i16); from_i64!(i32); +from_i64!(isize); from_i64!(u8); from_i64!(u16); from_i64!(u32); diff --git a/tests/config_log.rs b/tests/config_log.rs index f945210..6ae83d1 100644 --- a/tests/config_log.rs +++ b/tests/config_log.rs @@ -1,6 +1,7 @@ //! This file contains unit tests for rusqlite::trace::config_log. This function affects //! SQLite process-wide and so is not safe to run as a normal #[test] in the library. +#[cfg(feature = "trace")] #[macro_use] extern crate lazy_static; extern crate rusqlite;