module etc.c.sqlite3;/*** 2001-09-15**** The author disclaims copyright to this source code. In place of** a legal notice, here is a blessing:**** May you do good and not evil.** May you find forgiveness for yourself and forgive others.** May you share freely, never taking more than you give.***************************************************************************** This header file defines the interface that the SQLite library** presents to client programs. If a C-function, structure, datatype,** or constant definition does not appear in this file, then it is** not a published API of SQLite, is subject to change without** notice, and should not be referenced by programs that use SQLite.**** Some of the definitions that are in this file are marked as** "experimental". Experimental interfaces are normally new** features recently added to SQLite. We do not anticipate changes** to experimental interfaces but reserve the right to make minor changes** if experience from use "in the wild" suggest such changes are prudent.**** The official C-language API documentation for SQLite is derived** from comments in this file. This file is the authoritative source** on how SQLite interfaces are suppose to operate.**** The name of this file under configuration management is "sqlite.h.in".** The makefile makes some minor changes to this file (such as inserting** the version number) and changes its name to "sqlite3.h" as** part of the build process.*/ import core.stdc.stdarg : va_list;import core.stdc.config : c_ulong; extern (C) __gshared nothrow: /*** CAPI3REF: Compile-Time Library Version Numbers*/enum SQLITE_VERSION = "3.33.0";/// Dittoenum SQLITE_VERSION_NUMBER = 3033000;/// Dittoenum SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"; /*** CAPI3REF: Run-Time Library Version Numbers*/extern immutable(char)* sqlite3_version;/// Dittoimmutable(char)* sqlite3_libversion();/// Dittoimmutable(char)* sqlite3_sourceid();/// Dittoint sqlite3_libversion_number(); /*** CAPI3REF: Run-Time Library Compilation Options Diagnostics*/int sqlite3_compileoption_used(const char *zOptName);/// Dittoimmutable(char)* sqlite3_compileoption_get(int N); /*** CAPI3REF: Test To See If The Library Is Threadsafe*/int sqlite3_threadsafe(); /*** CAPI3REF: Database Connection Handle*/struct sqlite3; ///alias sqlite3_int64 = long;///alias sqlite3_uint64 = ulong; /*** CAPI3REF: Closing A Database Connection**/int sqlite3_close(sqlite3 *);int sqlite3_close_v2(sqlite3*); /*** The type for a callback function.* This is legacy and deprecated. It is included for historical* compatibility and is not documented.*/alias sqlite3_callback = int function (void*,int,char**, char**); /*** CAPI3REF: One-Step Query Execution Interface*/int sqlite3_exec( sqlite3*, /** An open database */ const(char)*sql, /** SQL to be evaluated */ int function (void*,int,char**,char**) callback, /** Callback function */ void *, /** 1st argument to callback */ char **errmsg /** Error msg written here */); /*** CAPI3REF: Result Codes*/enum{ SQLITE_OK = 0, /** Successful result *//* beginning-of-error-codes *//// Ditto SQLITE_ERROR = 1, /** Generic error */ SQLITE_INTERNAL = 2, /** Internal logic error in SQLite */ SQLITE_PERM = 3, /** Access permission denied */ SQLITE_ABORT = 4, /** Callback routine requested an abort */ SQLITE_BUSY = 5, /** The database file is locked */ SQLITE_LOCKED = 6, /** A table in the database is locked */ SQLITE_NOMEM = 7, /** A malloc() failed */ SQLITE_READONLY = 8, /** Attempt to write a readonly database */ SQLITE_INTERRUPT = 9, /** Operation terminated by sqlite3_interrupt()*/ SQLITE_IOERR = 10, /** Some kind of disk I/O error occurred */ SQLITE_CORRUPT = 11, /** The database disk image is malformed */ SQLITE_NOTFOUND = 12, /** Unknown opcode in sqlite3_file_control() */ SQLITE_FULL = 13, /** Insertion failed because database is full */ SQLITE_CANTOPEN = 14, /** Unable to open the database file */ SQLITE_PROTOCOL = 15, /** Database lock protocol error */ SQLITE_EMPTY = 16, /** Internal use only */ SQLITE_SCHEMA = 17, /** The database schema changed */ SQLITE_TOOBIG = 18, /** String or BLOB exceeds size limit */ SQLITE_CONSTRAINT = 19, /** Abort due to constraint violation */ SQLITE_MISMATCH = 20, /** Data type mismatch */ SQLITE_MISUSE = 21, /** Library used incorrectly */ SQLITE_NOLFS = 22, /** Uses OS features not supported on host */ SQLITE_AUTH = 23, /** Authorization denied */ SQLITE_FORMAT = 24, /** Not used */ SQLITE_RANGE = 25, /** 2nd parameter to sqlite3_bind out of range */ SQLITE_NOTADB = 26, /** File opened that is not a database file */ SQLITE_NOTICE = 27, SQLITE_WARNING = 28, SQLITE_ROW = 100, /** sqlite3_step() has another row ready */ SQLITE_DONE = 101 /** sqlite3_step() has finished executing */}/* end-of-error-codes */ /*** CAPI3REF: Extended Result Codes*/enum{ SQLITE_ERROR_MISSING_COLLSEQ = (SQLITE_ERROR | (1 << 8)), SQLITE_ERROR_RETRY = (SQLITE_ERROR | (2 << 8)), SQLITE_ERROR_SNAPSHOT = (SQLITE_ERROR | (3 << 8)), SQLITE_IOERR_READ = (SQLITE_IOERR | (1 << 8)), SQLITE_IOERR_SHORT_READ = (SQLITE_IOERR | (2 << 8)), SQLITE_IOERR_WRITE = (SQLITE_IOERR | (3 << 8)), SQLITE_IOERR_FSYNC = (SQLITE_IOERR | (4 << 8)), SQLITE_IOERR_DIR_FSYNC = (SQLITE_IOERR | (5 << 8)), SQLITE_IOERR_TRUNCATE = (SQLITE_IOERR | (6 << 8)), SQLITE_IOERR_FSTAT = (SQLITE_IOERR | (7 << 8)), SQLITE_IOERR_UNLOCK = (SQLITE_IOERR | (8 << 8)), SQLITE_IOERR_RDLOCK = (SQLITE_IOERR | (9 << 8)), SQLITE_IOERR_DELETE = (SQLITE_IOERR | (10 << 8)), SQLITE_IOERR_BLOCKED = (SQLITE_IOERR | (11 << 8)), SQLITE_IOERR_NOMEM = (SQLITE_IOERR | (12 << 8)), SQLITE_IOERR_ACCESS = (SQLITE_IOERR | (13 << 8)), SQLITE_IOERR_CHECKRESERVEDLOCK = (SQLITE_IOERR | (14 << 8)), SQLITE_IOERR_LOCK = (SQLITE_IOERR | (15 << 8)), SQLITE_IOERR_CLOSE = (SQLITE_IOERR | (16 << 8)), SQLITE_IOERR_DIR_CLOSE = (SQLITE_IOERR | (17 << 8)), SQLITE_IOERR_SHMOPEN = (SQLITE_IOERR | (18 << 8)), SQLITE_IOERR_SHMSIZE = (SQLITE_IOERR | (19 << 8)), SQLITE_IOERR_SHMLOCK = (SQLITE_IOERR | (20 << 8)), SQLITE_IOERR_SHMMAP = (SQLITE_IOERR | (21 << 8)), SQLITE_IOERR_SEEK = (SQLITE_IOERR | (22 << 8)), SQLITE_IOERR_DELETE_NOENT = (SQLITE_IOERR | (23 << 8)), SQLITE_IOERR_MMAP = (SQLITE_IOERR | (24 << 8)), SQLITE_IOERR_GETTEMPPATH = (SQLITE_IOERR | (25 << 8)), SQLITE_IOERR_CONVPATH = (SQLITE_IOERR | (26 << 8)), SQLITE_IOERR_VNODE = (SQLITE_IOERR | (27 << 8)), SQLITE_IOERR_AUTH = (SQLITE_IOERR | (28 << 8)), SQLITE_IOERR_BEGIN_ATOMIC = (SQLITE_IOERR | (29 << 8)), SQLITE_IOERR_COMMIT_ATOMIC = (SQLITE_IOERR | (30 << 8)), SQLITE_IOERR_ROLLBACK_ATOMIC = (SQLITE_IOERR | (31 << 8)), SQLITE_IOERR_DATA = (SQLITE_IOERR | (32 << 8)), SQLITE_LOCKED_SHAREDCACHE = (SQLITE_LOCKED | (1 << 8)), SQLITE_LOCKED_VTAB = (SQLITE_LOCKED | (2 << 8)), SQLITE_BUSY_RECOVERY = (SQLITE_BUSY | (1 << 8)), SQLITE_BUSY_SNAPSHOT = (SQLITE_BUSY | (2 << 8)), SQLITE_BUSY_TIMEOUT = (SQLITE_BUSY | (3 << 8)), SQLITE_CANTOPEN_NOTEMPDIR = (SQLITE_CANTOPEN | (1 << 8)), SQLITE_CANTOPEN_ISDIR = (SQLITE_CANTOPEN | (2 << 8)), SQLITE_CANTOPEN_FULLPATH = (SQLITE_CANTOPEN | (3 << 8)), SQLITE_CANTOPEN_CONVPATH = (SQLITE_CANTOPEN | (4 << 8)), SQLITE_CANTOPEN_DIRTYWAL = (SQLITE_CANTOPEN | (5 << 8)), /* Not Used */ SQLITE_CANTOPEN_SYMLINK = (SQLITE_CANTOPEN | (6 << 8)), SQLITE_CORRUPT_VTAB = (SQLITE_CORRUPT | (1 << 8)), SQLITE_CORRUPT_SEQUENCE = (SQLITE_CORRUPT | (2 << 8)), SQLITE_CORRUPT_INDEX = (SQLITE_CORRUPT | (3 << 8)), SQLITE_READONLY_RECOVERY = (SQLITE_READONLY | (1 << 8)), SQLITE_READONLY_CANTLOCK = (SQLITE_READONLY | (2 << 8)), SQLITE_READONLY_ROLLBACK = (SQLITE_READONLY | (3 << 8)), SQLITE_READONLY_DBMOVED = (SQLITE_READONLY | (4 << 8)), SQLITE_READONLY_CANTINIT = (SQLITE_READONLY | (5 << 8)), SQLITE_READONLY_DIRECTORY = (SQLITE_READONLY | (6 << 8)), SQLITE_ABORT_ROLLBACK = (SQLITE_ABORT | (2 << 8)), SQLITE_CONSTRAINT_CHECK = (SQLITE_CONSTRAINT | (1 << 8)), SQLITE_CONSTRAINT_COMMITHOOK = (SQLITE_CONSTRAINT | (2 << 8)), SQLITE_CONSTRAINT_FOREIGNKEY = (SQLITE_CONSTRAINT | (3 << 8)), SQLITE_CONSTRAINT_FUNCTION = (SQLITE_CONSTRAINT | (4 << 8)), SQLITE_CONSTRAINT_NOTNULL = (SQLITE_CONSTRAINT | (5 << 8)), SQLITE_CONSTRAINT_PRIMARYKEY = (SQLITE_CONSTRAINT | (6 << 8)), SQLITE_CONSTRAINT_TRIGGER = (SQLITE_CONSTRAINT | (7 << 8)), SQLITE_CONSTRAINT_UNIQUE = (SQLITE_CONSTRAINT | (8 << 8)), SQLITE_CONSTRAINT_VTAB = (SQLITE_CONSTRAINT | (9 << 8)), SQLITE_CONSTRAINT_ROWID = (SQLITE_CONSTRAINT |(10 << 8)), QLITE_CONSTRAINT_PINNED = (SQLITE_CONSTRAINT |(11 << 8)), SQLITE_NOTICE_RECOVER_WAL = (SQLITE_NOTICE | (1 << 8)), SQLITE_NOTICE_RECOVER_ROLLBACK = (SQLITE_NOTICE | (2 << 8)), SQLITE_WARNING_AUTOINDEX = (SQLITE_WARNING | (1 << 8)), SQLITE_AUTH_USER = (SQLITE_AUTH | (1 << 8)), SQLITE_OK_LOAD_PERMANENTLY = (SQLITE_OK | (1 << 8)), SQLITE_OK_SYMLINK = (SQLITE_OK | (2 << 8))} /*** CAPI3REF: Flags For File Open Operations*/enum{ SQLITE_OPEN_READONLY = 0x00000001, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_READWRITE = 0x00000002, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_CREATE = 0x00000004, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_DELETEONCLOSE = 0x00000008, /** VFS only */ SQLITE_OPEN_EXCLUSIVE = 0x00000010, /** VFS only */ SQLITE_OPEN_AUTOPROXY = 0x00000020, /** VFS only */ SQLITE_OPEN_URI = 0x00000040, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_MEMORY = 0x00000080, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_MAIN_DB = 0x00000100, /** VFS only */ SQLITE_OPEN_TEMP_DB = 0x00000200, /** VFS only */ SQLITE_OPEN_TRANSIENT_DB = 0x00000400, /** VFS only */ SQLITE_OPEN_MAIN_JOURNAL = 0x00000800, /** VFS only */ SQLITE_OPEN_TEMP_JOURNAL = 0x00001000, /** VFS only */ SQLITE_OPEN_SUBJOURNAL = 0x00002000, /** VFS only */ SQLITE_OPEN_SUPER_JOURNAL = 0x00004000, /** VFS only */ SQLITE_OPEN_NOMUTEX = 0x00008000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_FULLMUTEX = 0x00010000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_SHAREDCACHE = 0x00020000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_PRIVATECACHE = 0x00040000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_WAL = 0x00080000, /** VFS only */ SQLITE_OPEN_NOFOLLOW = 0x01000000 /** Ok for sqlite3_open_v2() */} deprecated ("Legacy compatibility"){ alias SQLITE_OPEN_MASTER_JOURNAL = SQLITE_OPEN_SUPER_JOURNAL; /** VFS only */} /*** CAPI3REF: Device Characteristics*/enum{ SQLITE_IOCAP_ATOMIC = 0x00000001, SQLITE_IOCAP_ATOMIC512 = 0x00000002, SQLITE_IOCAP_ATOMIC1K = 0x00000004, SQLITE_IOCAP_ATOMIC2K = 0x00000008, SQLITE_IOCAP_ATOMIC4K = 0x00000010, SQLITE_IOCAP_ATOMIC8K = 0x00000020, SQLITE_IOCAP_ATOMIC16K = 0x00000040, SQLITE_IOCAP_ATOMIC32K = 0x00000080, SQLITE_IOCAP_ATOMIC64K = 0x00000100, SQLITE_IOCAP_SAFE_APPEND = 0x00000200, SQLITE_IOCAP_SEQUENTIAL = 0x00000400, SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 0x00000800, SQLITE_IOCAP_POWERSAFE_OVERWRITE = 0x00001000, SQLITE_IOCAP_IMMUTABLE = 0x00002000, SQLITE_IOCAP_BATCH_ATOMIC = 0x00004000} /*** CAPI3REF: File Locking Levels*/enum{ SQLITE_LOCK_NONE = 0, SQLITE_LOCK_SHARED = 1, SQLITE_LOCK_RESERVED = 2, SQLITE_LOCK_PENDING = 3, SQLITE_LOCK_EXCLUSIVE = 4} /*** CAPI3REF: Synchronization Type Flags*/enum{ SQLITE_SYNC_NORMAL = 0x00002, SQLITE_SYNC_FULL = 0x00003, SQLITE_SYNC_DATAONLY = 0x00010} /*** CAPI3REF: OS Interface Open File Handle*/struct sqlite3_file{ const(sqlite3_io_methods)*pMethods; /* Methods for an open file */} /*** CAPI3REF: OS Interface File Virtual Methods Object*/ struct sqlite3_io_methods{ int iVersion; int function (sqlite3_file*) xClose; int function (sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst) xRead; int function (sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst) xWrite; int function (sqlite3_file*, sqlite3_int64 size) xTruncate; int function (sqlite3_file*, int flags) xSync; int function (sqlite3_file*, sqlite3_int64 *pSize) xFileSize; int function (sqlite3_file*, int) xLock; int function (sqlite3_file*, int) xUnlock; int function (sqlite3_file*, int *pResOut) xCheckReservedLock; int function (sqlite3_file*, int op, void *pArg) xFileControl; int function (sqlite3_file*) xSectorSize; int function (sqlite3_file*) xDeviceCharacteristics; /* Methods above are valid for version 1 */ int function (sqlite3_file*, int iPg, int pgsz, int, void **) xShmMap; int function (sqlite3_file*, int offset, int n, int flags) xShmLock; void function (sqlite3_file*) xShmBarrier; int function (sqlite3_file*, int deleteFlag) xShmUnmap; /* Methods above are valid for version 2 */ /* Additional methods may be added in future releases */ int function (sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp) xFetch; int function (sqlite3_file*, sqlite3_int64 iOfst, void *p) xUnfetch;} /*** CAPI3REF: Standard File Control Opcodes*/enum{ SQLITE_FCNTL_LOCKSTATE = 1, SQLITE_FCNTL_GET_LOCKPROXYFILE = 2, SQLITE_FCNTL_SET_LOCKPROXYFILE = 3, SQLITE_FCNTL_LAST_ERRNO = 4, SQLITE_FCNTL_SIZE_HINT = 5, SQLITE_FCNTL_CHUNK_SIZE = 6, SQLITE_FCNTL_FILE_POINTER = 7, SQLITE_FCNTL_SYNC_OMITTED = 8, SQLITE_FCNTL_WIN32_AV_RETRY = 9, SQLITE_FCNTL_PERSIST_WAL = 10, SQLITE_FCNTL_OVERWRITE = 11, SQLITE_FCNTL_VFSNAME = 12, SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13, SQLITE_FCNTL_PRAGMA = 14, SQLITE_FCNTL_BUSYHANDLER = 15, SQLITE_FCNTL_TEMPFILENAME = 16, SQLITE_FCNTL_MMAP_SIZE = 18, SQLITE_FCNTL_TRACE = 19, SQLITE_FCNTL_HAS_MOVED = 20, SQLITE_FCNTL_SYNC = 21, SQLITE_FCNTL_COMMIT_PHASETWO = 22, SQLITE_FCNTL_WIN32_SET_HANDLE = 23, SQLITE_FCNTL_WAL_BLOCK = 24, SQLITE_FCNTL_ZIPVFS = 25, SQLITE_FCNTL_RBU = 26, SQLITE_FCNTL_VFS_POINTER = 27, SQLITE_FCNTL_JOURNAL_POINTER = 28, SQLITE_FCNTL_WIN32_GET_HANDLE = 29, SQLITE_FCNTL_PDB = 30, SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = 32, SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33, SQLITE_FCNTL_LOCK_TIMEOUT = 34, SQLITE_FCNTL_DATA_VERSION = 35, SQLITE_FCNTL_SIZE_LIMIT = 36, SQLITE_FCNTL_CKPT_DONE = 37, SQLITE_FCNTL_RESERVE_BYTES = 38, SQLITE_FCNTL_CKPT_START = 39} deprecated ("deprecated names"){ alias SQLITE_GET_LOCKPROXYFILE = SQLITE_FCNTL_GET_LOCKPROXYFILE; alias SQLITE_SET_LOCKPROXYFILE = SQLITE_FCNTL_SET_LOCKPROXYFILE; alias SQLITE_LAST_ERRNO = SQLITE_FCNTL_LAST_ERRNO;} /*** CAPI3REF: Mutex Handle*/struct sqlite3_mutex; /*** CAPI3REF: Loadable Extension Thunk*/struct sqlite3_api_routines; /*** CAPI3REF: OS Interface Object*/ alias xDlSymReturn = void * function();/// Dittoalias sqlite3_syscall_ptr = void function(); struct sqlite3_vfs{ int iVersion; /** Structure version number (currently 2) */ int szOsFile; /** Size of subclassed sqlite3_file */ int mxPathname; /** Maximum file pathname length */ sqlite3_vfs *pNext; /** Next registered VFS */ const(char)*zName; /** Name of this virtual file system */ void *pAppData; /** Pointer to application-specific data */ int function (sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags) xOpen; int function (sqlite3_vfs*, const char *zName, int syncDir) xDelete; int function (sqlite3_vfs*, const char *zName, int flags, int *pResOut) xAccess; int function (sqlite3_vfs*, const char *zName, int nOut, char *zOut) xFullPathname; void* function (sqlite3_vfs*, const char *zFilename) xDlOpen; void function (sqlite3_vfs*, int nByte, char *zErrMsg) xDlError; xDlSymReturn function (sqlite3_vfs*,void*, const char *zSymbol) *xDlSym; void function (sqlite3_vfs*, void*) xDlClose; int function (sqlite3_vfs*, int nByte, char *zOut) xRandomness; int function (sqlite3_vfs*, int microseconds) xSleep; int function (sqlite3_vfs*, double*) xCurrentTime; int function (sqlite3_vfs*, int, char *) xGetLastError; /* ** The methods above are in version 1 of the sqlite_vfs object ** definition. Those that follow are added in version 2 or later */ int function (sqlite3_vfs*, sqlite3_int64*) xCurrentTimeInt64; /* ** The methods above are in versions 1 and 2 of the sqlite_vfs object. ** Those below are for version 3 and greater. */ int function(sqlite3_vfs*, const char * zName, sqlite3_syscall_ptr) xSetSystemCall; sqlite3_syscall_ptr function(sqlite3_vfs*, const char * zName) xGetSystemCall; const(char)* function(sqlite3_vfs*, const char * zName) xNextSystemCall; /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in figure versions. The iVersion ** value will increment whenever this happens. */} /*** CAPI3REF: Flags for the xAccess VFS method*/enum{ SQLITE_ACCESS_EXISTS = 0, SQLITE_ACCESS_READWRITE = 1, /** Used by PRAGMA temp_store_directory */ SQLITE_ACCESS_READ = 2 /** Unused */} /*** CAPI3REF: Flags for the xShmLock VFS method*/enum{ SQLITE_SHM_UNLOCK = 1, SQLITE_SHM_LOCK = 2, SQLITE_SHM_SHARED = 4, SQLITE_SHM_EXCLUSIVE = 8} /*** CAPI3REF: Maximum xShmLock index*/enum SQLITE_SHM_NLOCK = 8; /*** CAPI3REF: Initialize The SQLite Library*/int sqlite3_initialize();/// Dittoint sqlite3_shutdown();/// Dittoint sqlite3_os_init();/// Dittoint sqlite3_os_end(); /*** CAPI3REF: Configuring The SQLite Library*/int sqlite3_config(int, ...); /*** CAPI3REF: Configure database connections*/int sqlite3_db_config(sqlite3*, int op, ...);Lines 1–500 of 2880. Load more
module etc.c.sqlite3; /* ** 2001-09-15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the SQLite library ** presents to client programs. If a C-function, structure, datatype, ** or constant definition does not appear in this file, then it is ** not a published API of SQLite, is subject to change without ** notice, and should not be referenced by programs that use SQLite. ** ** Some of the definitions that are in this file are marked as ** "experimental". Experimental interfaces are normally new ** features recently added to SQLite. We do not anticipate changes ** to experimental interfaces but reserve the right to make minor changes ** if experience from use "in the wild" suggest such changes are prudent. ** ** The official C-language API documentation for SQLite is derived ** from comments in this file. This file is the authoritative source ** on how SQLite interfaces are suppose to operate. ** ** The name of this file under configuration management is "sqlite.h.in". ** The makefile makes some minor changes to this file (such as inserting ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. */ import core.stdc.stdarg : va_list; import core.stdc.config : c_ulong; extern (C) __gshared nothrow: /** * CAPI3REF: Compile-Time Library Version Numbers */ enum SQLITE_VERSION = "3.33.0"; /// Ditto enum SQLITE_VERSION_NUMBER = 3033000; /// Ditto enum SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"; /** * CAPI3REF: Run-Time Library Version Numbers */ extern immutable(char)* sqlite3_version; /// Ditto immutable(char)* sqlite3_libversion(); /// Ditto immutable(char)* sqlite3_sourceid(); /// Ditto int sqlite3_libversion_number(); /** * CAPI3REF: Run-Time Library Compilation Options Diagnostics */ int sqlite3_compileoption_used(const char *zOptName); /// Ditto immutable(char)* sqlite3_compileoption_get(int N); /** * CAPI3REF: Test To See If The Library Is Threadsafe */ int sqlite3_threadsafe(); /** * CAPI3REF: Database Connection Handle */ struct sqlite3; /// alias sqlite3_int64 = long; /// alias sqlite3_uint64 = ulong; /** * CAPI3REF: Closing A Database Connection * */ int sqlite3_close(sqlite3 *); int sqlite3_close_v2(sqlite3*); /** * The type for a callback function. * This is legacy and deprecated. It is included for historical * compatibility and is not documented. */ alias sqlite3_callback = int function (void*,int,char**, char**); /** * CAPI3REF: One-Step Query Execution Interface */ int sqlite3_exec( sqlite3*, /** An open database */ const(char)*sql, /** SQL to be evaluated */ int function (void*,int,char**,char**) callback, /** Callback function */ void *, /** 1st argument to callback */ char **errmsg /** Error msg written here */ ); /** * CAPI3REF: Result Codes */ enum { SQLITE_OK = 0, /** Successful result */ /* beginning-of-error-codes */ /// Ditto SQLITE_ERROR = 1, /** Generic error */ SQLITE_INTERNAL = 2, /** Internal logic error in SQLite */ SQLITE_PERM = 3, /** Access permission denied */ SQLITE_ABORT = 4, /** Callback routine requested an abort */ SQLITE_BUSY = 5, /** The database file is locked */ SQLITE_LOCKED = 6, /** A table in the database is locked */ SQLITE_NOMEM = 7, /** A malloc() failed */ SQLITE_READONLY = 8, /** Attempt to write a readonly database */ SQLITE_INTERRUPT = 9, /** Operation terminated by sqlite3_interrupt()*/ SQLITE_IOERR = 10, /** Some kind of disk I/O error occurred */ SQLITE_CORRUPT = 11, /** The database disk image is malformed */ SQLITE_NOTFOUND = 12, /** Unknown opcode in sqlite3_file_control() */ SQLITE_FULL = 13, /** Insertion failed because database is full */ SQLITE_CANTOPEN = 14, /** Unable to open the database file */ SQLITE_PROTOCOL = 15, /** Database lock protocol error */ SQLITE_EMPTY = 16, /** Internal use only */ SQLITE_SCHEMA = 17, /** The database schema changed */ SQLITE_TOOBIG = 18, /** String or BLOB exceeds size limit */ SQLITE_CONSTRAINT = 19, /** Abort due to constraint violation */ SQLITE_MISMATCH = 20, /** Data type mismatch */ SQLITE_MISUSE = 21, /** Library used incorrectly */ SQLITE_NOLFS = 22, /** Uses OS features not supported on host */ SQLITE_AUTH = 23, /** Authorization denied */ SQLITE_FORMAT = 24, /** Not used */ SQLITE_RANGE = 25, /** 2nd parameter to sqlite3_bind out of range */ SQLITE_NOTADB = 26, /** File opened that is not a database file */ SQLITE_NOTICE = 27, SQLITE_WARNING = 28, SQLITE_ROW = 100, /** sqlite3_step() has another row ready */ SQLITE_DONE = 101 /** sqlite3_step() has finished executing */ } /* end-of-error-codes */ /** * CAPI3REF: Extended Result Codes */ enum { SQLITE_ERROR_MISSING_COLLSEQ = (SQLITE_ERROR | (1 << 8)), SQLITE_ERROR_RETRY = (SQLITE_ERROR | (2 << 8)), SQLITE_ERROR_SNAPSHOT = (SQLITE_ERROR | (3 << 8)), SQLITE_IOERR_READ = (SQLITE_IOERR | (1 << 8)), SQLITE_IOERR_SHORT_READ = (SQLITE_IOERR | (2 << 8)), SQLITE_IOERR_WRITE = (SQLITE_IOERR | (3 << 8)), SQLITE_IOERR_FSYNC = (SQLITE_IOERR | (4 << 8)), SQLITE_IOERR_DIR_FSYNC = (SQLITE_IOERR | (5 << 8)), SQLITE_IOERR_TRUNCATE = (SQLITE_IOERR | (6 << 8)), SQLITE_IOERR_FSTAT = (SQLITE_IOERR | (7 << 8)), SQLITE_IOERR_UNLOCK = (SQLITE_IOERR | (8 << 8)), SQLITE_IOERR_RDLOCK = (SQLITE_IOERR | (9 << 8)), SQLITE_IOERR_DELETE = (SQLITE_IOERR | (10 << 8)), SQLITE_IOERR_BLOCKED = (SQLITE_IOERR | (11 << 8)), SQLITE_IOERR_NOMEM = (SQLITE_IOERR | (12 << 8)), SQLITE_IOERR_ACCESS = (SQLITE_IOERR | (13 << 8)), SQLITE_IOERR_CHECKRESERVEDLOCK = (SQLITE_IOERR | (14 << 8)), SQLITE_IOERR_LOCK = (SQLITE_IOERR | (15 << 8)), SQLITE_IOERR_CLOSE = (SQLITE_IOERR | (16 << 8)), SQLITE_IOERR_DIR_CLOSE = (SQLITE_IOERR | (17 << 8)), SQLITE_IOERR_SHMOPEN = (SQLITE_IOERR | (18 << 8)), SQLITE_IOERR_SHMSIZE = (SQLITE_IOERR | (19 << 8)), SQLITE_IOERR_SHMLOCK = (SQLITE_IOERR | (20 << 8)), SQLITE_IOERR_SHMMAP = (SQLITE_IOERR | (21 << 8)), SQLITE_IOERR_SEEK = (SQLITE_IOERR | (22 << 8)), SQLITE_IOERR_DELETE_NOENT = (SQLITE_IOERR | (23 << 8)), SQLITE_IOERR_MMAP = (SQLITE_IOERR | (24 << 8)), SQLITE_IOERR_GETTEMPPATH = (SQLITE_IOERR | (25 << 8)), SQLITE_IOERR_CONVPATH = (SQLITE_IOERR | (26 << 8)), SQLITE_IOERR_VNODE = (SQLITE_IOERR | (27 << 8)), SQLITE_IOERR_AUTH = (SQLITE_IOERR | (28 << 8)), SQLITE_IOERR_BEGIN_ATOMIC = (SQLITE_IOERR | (29 << 8)), SQLITE_IOERR_COMMIT_ATOMIC = (SQLITE_IOERR | (30 << 8)), SQLITE_IOERR_ROLLBACK_ATOMIC = (SQLITE_IOERR | (31 << 8)), SQLITE_IOERR_DATA = (SQLITE_IOERR | (32 << 8)), SQLITE_LOCKED_SHAREDCACHE = (SQLITE_LOCKED | (1 << 8)), SQLITE_LOCKED_VTAB = (SQLITE_LOCKED | (2 << 8)), SQLITE_BUSY_RECOVERY = (SQLITE_BUSY | (1 << 8)), SQLITE_BUSY_SNAPSHOT = (SQLITE_BUSY | (2 << 8)), SQLITE_BUSY_TIMEOUT = (SQLITE_BUSY | (3 << 8)), SQLITE_CANTOPEN_NOTEMPDIR = (SQLITE_CANTOPEN | (1 << 8)), SQLITE_CANTOPEN_ISDIR = (SQLITE_CANTOPEN | (2 << 8)), SQLITE_CANTOPEN_FULLPATH = (SQLITE_CANTOPEN | (3 << 8)), SQLITE_CANTOPEN_CONVPATH = (SQLITE_CANTOPEN | (4 << 8)), SQLITE_CANTOPEN_DIRTYWAL = (SQLITE_CANTOPEN | (5 << 8)), /* Not Used */ SQLITE_CANTOPEN_SYMLINK = (SQLITE_CANTOPEN | (6 << 8)), SQLITE_CORRUPT_VTAB = (SQLITE_CORRUPT | (1 << 8)), SQLITE_CORRUPT_SEQUENCE = (SQLITE_CORRUPT | (2 << 8)), SQLITE_CORRUPT_INDEX = (SQLITE_CORRUPT | (3 << 8)), SQLITE_READONLY_RECOVERY = (SQLITE_READONLY | (1 << 8)), SQLITE_READONLY_CANTLOCK = (SQLITE_READONLY | (2 << 8)), SQLITE_READONLY_ROLLBACK = (SQLITE_READONLY | (3 << 8)), SQLITE_READONLY_DBMOVED = (SQLITE_READONLY | (4 << 8)), SQLITE_READONLY_CANTINIT = (SQLITE_READONLY | (5 << 8)), SQLITE_READONLY_DIRECTORY = (SQLITE_READONLY | (6 << 8)), SQLITE_ABORT_ROLLBACK = (SQLITE_ABORT | (2 << 8)), SQLITE_CONSTRAINT_CHECK = (SQLITE_CONSTRAINT | (1 << 8)), SQLITE_CONSTRAINT_COMMITHOOK = (SQLITE_CONSTRAINT | (2 << 8)), SQLITE_CONSTRAINT_FOREIGNKEY = (SQLITE_CONSTRAINT | (3 << 8)), SQLITE_CONSTRAINT_FUNCTION = (SQLITE_CONSTRAINT | (4 << 8)), SQLITE_CONSTRAINT_NOTNULL = (SQLITE_CONSTRAINT | (5 << 8)), SQLITE_CONSTRAINT_PRIMARYKEY = (SQLITE_CONSTRAINT | (6 << 8)), SQLITE_CONSTRAINT_TRIGGER = (SQLITE_CONSTRAINT | (7 << 8)), SQLITE_CONSTRAINT_UNIQUE = (SQLITE_CONSTRAINT | (8 << 8)), SQLITE_CONSTRAINT_VTAB = (SQLITE_CONSTRAINT | (9 << 8)), SQLITE_CONSTRAINT_ROWID = (SQLITE_CONSTRAINT |(10 << 8)), QLITE_CONSTRAINT_PINNED = (SQLITE_CONSTRAINT |(11 << 8)), SQLITE_NOTICE_RECOVER_WAL = (SQLITE_NOTICE | (1 << 8)), SQLITE_NOTICE_RECOVER_ROLLBACK = (SQLITE_NOTICE | (2 << 8)), SQLITE_WARNING_AUTOINDEX = (SQLITE_WARNING | (1 << 8)), SQLITE_AUTH_USER = (SQLITE_AUTH | (1 << 8)), SQLITE_OK_LOAD_PERMANENTLY = (SQLITE_OK | (1 << 8)), SQLITE_OK_SYMLINK = (SQLITE_OK | (2 << 8)) } /** * CAPI3REF: Flags For File Open Operations */ enum { SQLITE_OPEN_READONLY = 0x00000001, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_READWRITE = 0x00000002, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_CREATE = 0x00000004, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_DELETEONCLOSE = 0x00000008, /** VFS only */ SQLITE_OPEN_EXCLUSIVE = 0x00000010, /** VFS only */ SQLITE_OPEN_AUTOPROXY = 0x00000020, /** VFS only */ SQLITE_OPEN_URI = 0x00000040, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_MEMORY = 0x00000080, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_MAIN_DB = 0x00000100, /** VFS only */ SQLITE_OPEN_TEMP_DB = 0x00000200, /** VFS only */ SQLITE_OPEN_TRANSIENT_DB = 0x00000400, /** VFS only */ SQLITE_OPEN_MAIN_JOURNAL = 0x00000800, /** VFS only */ SQLITE_OPEN_TEMP_JOURNAL = 0x00001000, /** VFS only */ SQLITE_OPEN_SUBJOURNAL = 0x00002000, /** VFS only */ SQLITE_OPEN_SUPER_JOURNAL = 0x00004000, /** VFS only */ SQLITE_OPEN_NOMUTEX = 0x00008000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_FULLMUTEX = 0x00010000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_SHAREDCACHE = 0x00020000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_PRIVATECACHE = 0x00040000, /** Ok for sqlite3_open_v2() */ SQLITE_OPEN_WAL = 0x00080000, /** VFS only */ SQLITE_OPEN_NOFOLLOW = 0x01000000 /** Ok for sqlite3_open_v2() */ } deprecated ("Legacy compatibility") { alias SQLITE_OPEN_MASTER_JOURNAL = SQLITE_OPEN_SUPER_JOURNAL; /** VFS only */ } /** * CAPI3REF: Device Characteristics */ enum { SQLITE_IOCAP_ATOMIC = 0x00000001, SQLITE_IOCAP_ATOMIC512 = 0x00000002, SQLITE_IOCAP_ATOMIC1K = 0x00000004, SQLITE_IOCAP_ATOMIC2K = 0x00000008, SQLITE_IOCAP_ATOMIC4K = 0x00000010, SQLITE_IOCAP_ATOMIC8K = 0x00000020, SQLITE_IOCAP_ATOMIC16K = 0x00000040, SQLITE_IOCAP_ATOMIC32K = 0x00000080, SQLITE_IOCAP_ATOMIC64K = 0x00000100, SQLITE_IOCAP_SAFE_APPEND = 0x00000200, SQLITE_IOCAP_SEQUENTIAL = 0x00000400, SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 0x00000800, SQLITE_IOCAP_POWERSAFE_OVERWRITE = 0x00001000, SQLITE_IOCAP_IMMUTABLE = 0x00002000, SQLITE_IOCAP_BATCH_ATOMIC = 0x00004000 } /** * CAPI3REF: File Locking Levels */ enum { SQLITE_LOCK_NONE = 0, SQLITE_LOCK_SHARED = 1, SQLITE_LOCK_RESERVED = 2, SQLITE_LOCK_PENDING = 3, SQLITE_LOCK_EXCLUSIVE = 4 } /** * CAPI3REF: Synchronization Type Flags */ enum { SQLITE_SYNC_NORMAL = 0x00002, SQLITE_SYNC_FULL = 0x00003, SQLITE_SYNC_DATAONLY = 0x00010 } /** * CAPI3REF: OS Interface Open File Handle */ struct sqlite3_file { const(sqlite3_io_methods)*pMethods; /* Methods for an open file */ } /** * CAPI3REF: OS Interface File Virtual Methods Object */ struct sqlite3_io_methods { int iVersion; int function (sqlite3_file*) xClose; int function (sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst) xRead; int function (sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst) xWrite; int function (sqlite3_file*, sqlite3_int64 size) xTruncate; int function (sqlite3_file*, int flags) xSync; int function (sqlite3_file*, sqlite3_int64 *pSize) xFileSize; int function (sqlite3_file*, int) xLock; int function (sqlite3_file*, int) xUnlock; int function (sqlite3_file*, int *pResOut) xCheckReservedLock; int function (sqlite3_file*, int op, void *pArg) xFileControl; int function (sqlite3_file*) xSectorSize; int function (sqlite3_file*) xDeviceCharacteristics; /* Methods above are valid for version 1 */ int function (sqlite3_file*, int iPg, int pgsz, int, void **) xShmMap; int function (sqlite3_file*, int offset, int n, int flags) xShmLock; void function (sqlite3_file*) xShmBarrier; int function (sqlite3_file*, int deleteFlag) xShmUnmap; /* Methods above are valid for version 2 */ /* Additional methods may be added in future releases */ int function (sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp) xFetch; int function (sqlite3_file*, sqlite3_int64 iOfst, void *p) xUnfetch; } /** * CAPI3REF: Standard File Control Opcodes */ enum { SQLITE_FCNTL_LOCKSTATE = 1, SQLITE_FCNTL_GET_LOCKPROXYFILE = 2, SQLITE_FCNTL_SET_LOCKPROXYFILE = 3, SQLITE_FCNTL_LAST_ERRNO = 4, SQLITE_FCNTL_SIZE_HINT = 5, SQLITE_FCNTL_CHUNK_SIZE = 6, SQLITE_FCNTL_FILE_POINTER = 7, SQLITE_FCNTL_SYNC_OMITTED = 8, SQLITE_FCNTL_WIN32_AV_RETRY = 9, SQLITE_FCNTL_PERSIST_WAL = 10, SQLITE_FCNTL_OVERWRITE = 11, SQLITE_FCNTL_VFSNAME = 12, SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13, SQLITE_FCNTL_PRAGMA = 14, SQLITE_FCNTL_BUSYHANDLER = 15, SQLITE_FCNTL_TEMPFILENAME = 16, SQLITE_FCNTL_MMAP_SIZE = 18, SQLITE_FCNTL_TRACE = 19, SQLITE_FCNTL_HAS_MOVED = 20, SQLITE_FCNTL_SYNC = 21, SQLITE_FCNTL_COMMIT_PHASETWO = 22, SQLITE_FCNTL_WIN32_SET_HANDLE = 23, SQLITE_FCNTL_WAL_BLOCK = 24, SQLITE_FCNTL_ZIPVFS = 25, SQLITE_FCNTL_RBU = 26, SQLITE_FCNTL_VFS_POINTER = 27, SQLITE_FCNTL_JOURNAL_POINTER = 28, SQLITE_FCNTL_WIN32_GET_HANDLE = 29, SQLITE_FCNTL_PDB = 30, SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31, SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = 32, SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33, SQLITE_FCNTL_LOCK_TIMEOUT = 34, SQLITE_FCNTL_DATA_VERSION = 35, SQLITE_FCNTL_SIZE_LIMIT = 36, SQLITE_FCNTL_CKPT_DONE = 37, SQLITE_FCNTL_RESERVE_BYTES = 38, SQLITE_FCNTL_CKPT_START = 39 } deprecated ("deprecated names") { alias SQLITE_GET_LOCKPROXYFILE = SQLITE_FCNTL_GET_LOCKPROXYFILE; alias SQLITE_SET_LOCKPROXYFILE = SQLITE_FCNTL_SET_LOCKPROXYFILE; alias SQLITE_LAST_ERRNO = SQLITE_FCNTL_LAST_ERRNO; } /** * CAPI3REF: Mutex Handle */ struct sqlite3_mutex; /** * CAPI3REF: Loadable Extension Thunk */ struct sqlite3_api_routines; /** * CAPI3REF: OS Interface Object */ alias xDlSymReturn = void * function(); /// Ditto alias sqlite3_syscall_ptr = void function(); struct sqlite3_vfs { int iVersion; /** Structure version number (currently 2) */ int szOsFile; /** Size of subclassed sqlite3_file */ int mxPathname; /** Maximum file pathname length */ sqlite3_vfs *pNext; /** Next registered VFS */ const(char)*zName; /** Name of this virtual file system */ void *pAppData; /** Pointer to application-specific data */ int function (sqlite3_vfs*, const char *zName, sqlite3_file*, int flags, int *pOutFlags) xOpen; int function (sqlite3_vfs*, const char *zName, int syncDir) xDelete; int function (sqlite3_vfs*, const char *zName, int flags, int *pResOut) xAccess; int function (sqlite3_vfs*, const char *zName, int nOut, char *zOut) xFullPathname; void* function (sqlite3_vfs*, const char *zFilename) xDlOpen; void function (sqlite3_vfs*, int nByte, char *zErrMsg) xDlError; xDlSymReturn function (sqlite3_vfs*,void*, const char *zSymbol) *xDlSym; void function (sqlite3_vfs*, void*) xDlClose; int function (sqlite3_vfs*, int nByte, char *zOut) xRandomness; int function (sqlite3_vfs*, int microseconds) xSleep; int function (sqlite3_vfs*, double*) xCurrentTime; int function (sqlite3_vfs*, int, char *) xGetLastError; /* ** The methods above are in version 1 of the sqlite_vfs object ** definition. Those that follow are added in version 2 or later */ int function (sqlite3_vfs*, sqlite3_int64*) xCurrentTimeInt64; /* ** The methods above are in versions 1 and 2 of the sqlite_vfs object. ** Those below are for version 3 and greater. */ int function(sqlite3_vfs*, const char * zName, sqlite3_syscall_ptr) xSetSystemCall; sqlite3_syscall_ptr function(sqlite3_vfs*, const char * zName) xGetSystemCall; const(char)* function(sqlite3_vfs*, const char * zName) xNextSystemCall; /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in figure versions. The iVersion ** value will increment whenever this happens. */ } /** * CAPI3REF: Flags for the xAccess VFS method */ enum { SQLITE_ACCESS_EXISTS = 0, SQLITE_ACCESS_READWRITE = 1, /** Used by PRAGMA temp_store_directory */ SQLITE_ACCESS_READ = 2 /** Unused */ } /** * CAPI3REF: Flags for the xShmLock VFS method */ enum { SQLITE_SHM_UNLOCK = 1, SQLITE_SHM_LOCK = 2, SQLITE_SHM_SHARED = 4, SQLITE_SHM_EXCLUSIVE = 8 } /** * CAPI3REF: Maximum xShmLock index */ enum SQLITE_SHM_NLOCK = 8; /** * CAPI3REF: Initialize The SQLite Library */ int sqlite3_initialize(); /// Ditto int sqlite3_shutdown(); /// Ditto int sqlite3_os_init(); /// Ditto int sqlite3_os_end(); /** * CAPI3REF: Configuring The SQLite Library */ int sqlite3_config(int, ...); /** * CAPI3REF: Configure database connections */ int sqlite3_db_config(sqlite3*, int op, ...);