Deleted Added
full compact
sqlite3.h (251886) sqlite3.h (269851)
1/*
2** 2001 September 15
3**
4** The author disclaims copyright to this source code. In place of
5** a legal notice, here is a blessing:
6**
7** May you do good and not evil.
8** May you find forgiveness for yourself and forgive others.

--- 93 unchanged lines hidden (view full) ---

102** within its configuration management system. ^The SQLITE_SOURCE_ID
103** string contains the date and time of the check-in (UTC) and an SHA1
104** hash of the entire source tree.
105**
106** See also: [sqlite3_libversion()],
107** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108** [sqlite_version()] and [sqlite_source_id()].
109*/
1/*
2** 2001 September 15
3**
4** The author disclaims copyright to this source code. In place of
5** a legal notice, here is a blessing:
6**
7** May you do good and not evil.
8** May you find forgiveness for yourself and forgive others.

--- 93 unchanged lines hidden (view full) ---

102** within its configuration management system. ^The SQLITE_SOURCE_ID
103** string contains the date and time of the check-in (UTC) and an SHA1
104** hash of the entire source tree.
105**
106** See also: [sqlite3_libversion()],
107** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108** [sqlite_version()] and [sqlite_source_id()].
109*/
110#define SQLITE_VERSION "3.7.17"
111#define SQLITE_VERSION_NUMBER 3007017
112#define SQLITE_SOURCE_ID "2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668"
110#define SQLITE_VERSION "3.8.5"
111#define SQLITE_VERSION_NUMBER 3008005
112#define SQLITE_SOURCE_ID "2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212"
113
114/*
115** CAPI3REF: Run-Time Library Version Numbers
116** KEYWORDS: sqlite3_version, sqlite3_sourceid
117**
118** These interfaces provide the same information as the [SQLITE_VERSION],
119** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
120** but are associated with the library instead of the header file. ^(Cautious

--- 244 unchanged lines hidden (view full) ---

365** SQL comments, then no SQL statements are evaluated and the database
366** is not changed.
367**
368** Restrictions:
369**
370** <ul>
371** <li> The application must insure that the 1st parameter to sqlite3_exec()
372** is a valid and open [database connection].
113
114/*
115** CAPI3REF: Run-Time Library Version Numbers
116** KEYWORDS: sqlite3_version, sqlite3_sourceid
117**
118** These interfaces provide the same information as the [SQLITE_VERSION],
119** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
120** but are associated with the library instead of the header file. ^(Cautious

--- 244 unchanged lines hidden (view full) ---

365** SQL comments, then no SQL statements are evaluated and the database
366** is not changed.
367**
368** Restrictions:
369**
370** <ul>
371** <li> The application must insure that the 1st parameter to sqlite3_exec()
372** is a valid and open [database connection].
373**
  • The application must not close [database connection] specified by
  • 373** <li> The application must not close the [database connection] specified by
    374** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
    375** <li> The application must not modify the SQL statement text passed into
    376** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
    377** </ul>
    378*/
    379SQLITE_API int sqlite3_exec(
    380 sqlite3*, /* An open database */
    381 const char *sql, /* SQL to be evaluated */

    --- 60 unchanged lines hidden (view full) ---

    442** much information about problems as programmers might like. In an effort to
    443** address this, newer versions of SQLite (version 3.3.8 and later) include
    444** support for additional result codes that provide more detailed information
    445** about errors. The extended result codes are enabled or disabled
    446** on a per database connection basis using the
    447** [sqlite3_extended_result_codes()] API.
    448**
    449** Some of the available extended result codes are listed here.
    374** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
    375** <li> The application must not modify the SQL statement text passed into
    376** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
    377** </ul>
    378*/
    379SQLITE_API int sqlite3_exec(
    380 sqlite3*, /* An open database */
    381 const char *sql, /* SQL to be evaluated */

    --- 60 unchanged lines hidden (view full) ---

    442** much information about problems as programmers might like. In an effort to
    443** address this, newer versions of SQLite (version 3.3.8 and later) include
    444** support for additional result codes that provide more detailed information
    445** about errors. The extended result codes are enabled or disabled
    446** on a per database connection basis using the
    447** [sqlite3_extended_result_codes()] API.
    448**
    449** Some of the available extended result codes are listed here.
    450** One may expect the number of extended result codes will be expand
    450** One may expect the number of extended result codes will increase
    451** over time. Software that uses extended result codes should expect
    452** to see new result codes in future releases of SQLite.
    453**
    454** The SQLITE_OK result code will never be extended. It will always
    455** be exactly zero.
    456*/
    457#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
    458#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))

    --- 14 unchanged lines hidden (view full) ---

    473#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8))
    474#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8))
    475#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8))
    476#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8))
    477#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8))
    478#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
    479#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
    480#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
    451** over time. Software that uses extended result codes should expect
    452** to see new result codes in future releases of SQLite.
    453**
    454** The SQLITE_OK result code will never be extended. It will always
    455** be exactly zero.
    456*/
    457#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
    458#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))

    --- 14 unchanged lines hidden (view full) ---

    473#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8))
    474#define SQLITE_IOERR_SHMOPEN (SQLITE_IOERR | (18<<8))
    475#define SQLITE_IOERR_SHMSIZE (SQLITE_IOERR | (19<<8))
    476#define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8))
    477#define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8))
    478#define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8))
    479#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8))
    480#define SQLITE_IOERR_MMAP (SQLITE_IOERR | (24<<8))
    481#define SQLITE_IOERR_GETTEMPPATH (SQLITE_IOERR | (25<<8))
    482#define SQLITE_IOERR_CONVPATH (SQLITE_IOERR | (26<<8))
    481#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
    482#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
    483#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
    484#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
    485#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
    483#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
    484#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8))
    485#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
    486#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
    487#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8))
    488#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
    489#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8))
    486#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
    487#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
    488#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
    489#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
    490#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
    491#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
    492#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
    493#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
    494#define SQLITE_READONLY_DBMOVED (SQLITE_READONLY | (4<<8))
    490#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8))
    491#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8))
    492#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8))
    493#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8))
    494#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8))
    495#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8))
    496#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8))
    497#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8))
    498#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8))
    499#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
    495#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8))
    496#define SQLITE_CONSTRAINT_CHECK (SQLITE_CONSTRAINT | (1<<8))
    497#define SQLITE_CONSTRAINT_COMMITHOOK (SQLITE_CONSTRAINT | (2<<8))
    498#define SQLITE_CONSTRAINT_FOREIGNKEY (SQLITE_CONSTRAINT | (3<<8))
    499#define SQLITE_CONSTRAINT_FUNCTION (SQLITE_CONSTRAINT | (4<<8))
    500#define SQLITE_CONSTRAINT_NOTNULL (SQLITE_CONSTRAINT | (5<<8))
    501#define SQLITE_CONSTRAINT_PRIMARYKEY (SQLITE_CONSTRAINT | (6<<8))
    502#define SQLITE_CONSTRAINT_TRIGGER (SQLITE_CONSTRAINT | (7<<8))
    503#define SQLITE_CONSTRAINT_UNIQUE (SQLITE_CONSTRAINT | (8<<8))
    504#define SQLITE_CONSTRAINT_VTAB (SQLITE_CONSTRAINT | (9<<8))
    505#define SQLITE_CONSTRAINT_ROWID (SQLITE_CONSTRAINT |(10<<8))
    500#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
    501#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
    506#define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
    507#define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
    508#define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
    502
    503/*
    504** CAPI3REF: Flags For File Open Operations
    505**
    506** These bit values are intended for use in the
    507** 3rd parameter to the [sqlite3_open_v2()] interface and
    508** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
    509*/

    --- 37 unchanged lines hidden (view full) ---

    547** that when data is appended to a file, the data is appended
    548** first then the size of the file is extended, never the other
    549** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
    550** information is written to disk in the same order as calls
    551** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
    552** after reboot following a crash or power loss, the only bytes in a
    553** file that were written at the application level might have changed
    554** and that adjacent bytes, even bytes within the same sector are
    509
    510/*
    511** CAPI3REF: Flags For File Open Operations
    512**
    513** These bit values are intended for use in the
    514** 3rd parameter to the [sqlite3_open_v2()] interface and
    515** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
    516*/

    --- 37 unchanged lines hidden (view full) ---

    554** that when data is appended to a file, the data is appended
    555** first then the size of the file is extended, never the other
    556** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
    557** information is written to disk in the same order as calls
    558** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
    559** after reboot following a crash or power loss, the only bytes in a
    560** file that were written at the application level might have changed
    561** and that adjacent bytes, even bytes within the same sector are
    555** guaranteed to be unchanged.
    562** guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
    563** flag indicate that a file cannot be deleted when open. The
    564** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
    565** read-only media and cannot be changed even by processes with
    566** elevated privileges.
    556*/
    557#define SQLITE_IOCAP_ATOMIC 0x00000001
    558#define SQLITE_IOCAP_ATOMIC512 0x00000002
    559#define SQLITE_IOCAP_ATOMIC1K 0x00000004
    560#define SQLITE_IOCAP_ATOMIC2K 0x00000008
    561#define SQLITE_IOCAP_ATOMIC4K 0x00000010
    562#define SQLITE_IOCAP_ATOMIC8K 0x00000020
    563#define SQLITE_IOCAP_ATOMIC16K 0x00000040
    564#define SQLITE_IOCAP_ATOMIC32K 0x00000080
    565#define SQLITE_IOCAP_ATOMIC64K 0x00000100
    566#define SQLITE_IOCAP_SAFE_APPEND 0x00000200
    567#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
    568#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
    569#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
    567*/
    568#define SQLITE_IOCAP_ATOMIC 0x00000001
    569#define SQLITE_IOCAP_ATOMIC512 0x00000002
    570#define SQLITE_IOCAP_ATOMIC1K 0x00000004
    571#define SQLITE_IOCAP_ATOMIC2K 0x00000008
    572#define SQLITE_IOCAP_ATOMIC4K 0x00000010
    573#define SQLITE_IOCAP_ATOMIC8K 0x00000020
    574#define SQLITE_IOCAP_ATOMIC16K 0x00000040
    575#define SQLITE_IOCAP_ATOMIC32K 0x00000080
    576#define SQLITE_IOCAP_ATOMIC64K 0x00000100
    577#define SQLITE_IOCAP_SAFE_APPEND 0x00000200
    578#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
    579#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
    580#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
    581#define SQLITE_IOCAP_IMMUTABLE 0x00002000
    570
    571/*
    572** CAPI3REF: File Locking Levels
    573**
    574** SQLite uses one of these integer values as the second
    575** argument to calls it makes to the xLock() and xUnlock() methods
    576** of an [sqlite3_io_methods] object.
    577*/

    --- 200 unchanged lines hidden (view full) ---

    778**
    779** <li>[[SQLITE_FCNTL_FILE_POINTER]]
    780** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
    781** to the [sqlite3_file] object associated with a particular database
    782** connection. See the [sqlite3_file_control()] documentation for
    783** additional information.
    784**
    785** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
    582
    583/*
    584** CAPI3REF: File Locking Levels
    585**
    586** SQLite uses one of these integer values as the second
    587** argument to calls it makes to the xLock() and xUnlock() methods
    588** of an [sqlite3_io_methods] object.
    589*/

    --- 200 unchanged lines hidden (view full) ---

    790**
    791** <li>[[SQLITE_FCNTL_FILE_POINTER]]
    792** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
    793** to the [sqlite3_file] object associated with a particular database
    794** connection. See the [sqlite3_file_control()] documentation for
    795** additional information.
    796**
    797** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
    786** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by
    787** SQLite and sent to all VFSes in place of a call to the xSync method
    788** when the database connection has [PRAGMA synchronous] set to OFF.)^
    789** Some specialized VFSes need this signal in order to operate correctly
    790** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most
    791** VFSes do not need this signal and should silently ignore this opcode.
    792** Applications should not call [sqlite3_file_control()] with this
    793** opcode as doing so may disrupt the operation of the specialized VFSes
    794** that do require it.
    798** No longer in use.
    795**
    799**
    800** <li>[[SQLITE_FCNTL_SYNC]]
    801** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
    802** sent to the VFS immediately before the xSync method is invoked on a
    803** database file descriptor. Or, if the xSync method is not invoked
    804** because the user has configured SQLite with
    805** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place
    806** of the xSync method. In most cases, the pointer argument passed with
    807** this file-control is NULL. However, if the database file is being synced
    808** as part of a multi-database commit, the argument points to a nul-terminated
    809** string containing the transactions master-journal file name. VFSes that
    810** do not need this signal should silently ignore this opcode. Applications
    811** should not call [sqlite3_file_control()] with this opcode as doing so may
    812** disrupt the operation of the specialized VFSes that do require it.
    813**
    814** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
    815** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
    816** and sent to the VFS after a transaction has been committed immediately
    817** but before the database is unlocked. VFSes that do not need this signal
    818** should silently ignore this opcode. Applications should not call
    819** [sqlite3_file_control()] with this opcode as doing so may disrupt the
    820** operation of the specialized VFSes that do require it.
    821**
    796** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
    797** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
    798** retry counts and intervals for certain disk I/O operations for the
    799** windows [VFS] in order to provide robustness in the presence of
    800** anti-virus programs. By default, the windows VFS will retry file read,
    801** file write, and file delete operations up to 10 times, with a delay
    802** of 25 milliseconds before the first retry and with the delay increasing
    803** by an additional 25 milliseconds with each subsequent retry. This

    --- 98 unchanged lines hidden (view full) ---

    902** maximum number of bytes that will be used for memory-mapped I/O.
    903** The argument is a pointer to a value of type sqlite3_int64 that
    904** is an advisory maximum number of bytes in the file to memory map. The
    905** pointer is overwritten with the old value. The limit is not changed if
    906** the value originally pointed to is negative, and so the current limit
    907** can be queried by passing in a pointer to a negative number. This
    908** file-control is used internally to implement [PRAGMA mmap_size].
    909**
    822** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
    823** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
    824** retry counts and intervals for certain disk I/O operations for the
    825** windows [VFS] in order to provide robustness in the presence of
    826** anti-virus programs. By default, the windows VFS will retry file read,
    827** file write, and file delete operations up to 10 times, with a delay
    828** of 25 milliseconds before the first retry and with the delay increasing
    829** by an additional 25 milliseconds with each subsequent retry. This

    --- 98 unchanged lines hidden (view full) ---

    928** maximum number of bytes that will be used for memory-mapped I/O.
    929** The argument is a pointer to a value of type sqlite3_int64 that
    930** is an advisory maximum number of bytes in the file to memory map. The
    931** pointer is overwritten with the old value. The limit is not changed if
    932** the value originally pointed to is negative, and so the current limit
    933** can be queried by passing in a pointer to a negative number. This
    934** file-control is used internally to implement [PRAGMA mmap_size].
    935**
    936** <li>[[SQLITE_FCNTL_TRACE]]
    937** The [SQLITE_FCNTL_TRACE] file control provides advisory information
    938** to the VFS about what the higher layers of the SQLite stack are doing.
    939** This file control is used by some VFS activity tracing [shims].
    940** The argument is a zero-terminated string. Higher layers in the
    941** SQLite stack may generate instances of this file control if
    942** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
    943**
    944** <li>[[SQLITE_FCNTL_HAS_MOVED]]
    945** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
    946** pointer to an integer and it writes a boolean into that integer depending
    947** on whether or not the file has been renamed, moved, or deleted since it
    948** was first opened.
    949**
    950** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
    951** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This
    952** opcode causes the xFileControl method to swap the file handle with the one
    953** pointed to by the pArg argument. This capability is used during testing
    954** and only needs to be supported when SQLITE_TEST is defined.
    955**
    910** </ul>
    911*/
    912#define SQLITE_FCNTL_LOCKSTATE 1
    913#define SQLITE_GET_LOCKPROXYFILE 2
    914#define SQLITE_SET_LOCKPROXYFILE 3
    915#define SQLITE_LAST_ERRNO 4
    916#define SQLITE_FCNTL_SIZE_HINT 5
    917#define SQLITE_FCNTL_CHUNK_SIZE 6
    918#define SQLITE_FCNTL_FILE_POINTER 7
    919#define SQLITE_FCNTL_SYNC_OMITTED 8
    920#define SQLITE_FCNTL_WIN32_AV_RETRY 9
    921#define SQLITE_FCNTL_PERSIST_WAL 10
    922#define SQLITE_FCNTL_OVERWRITE 11
    923#define SQLITE_FCNTL_VFSNAME 12
    924#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13
    925#define SQLITE_FCNTL_PRAGMA 14
    926#define SQLITE_FCNTL_BUSYHANDLER 15
    927#define SQLITE_FCNTL_TEMPFILENAME 16
    928#define SQLITE_FCNTL_MMAP_SIZE 18
    956** </ul>
    957*/
    958#define SQLITE_FCNTL_LOCKSTATE 1
    959#define SQLITE_GET_LOCKPROXYFILE 2
    960#define SQLITE_SET_LOCKPROXYFILE 3
    961#define SQLITE_LAST_ERRNO 4
    962#define SQLITE_FCNTL_SIZE_HINT 5
    963#define SQLITE_FCNTL_CHUNK_SIZE 6
    964#define SQLITE_FCNTL_FILE_POINTER 7
    965#define SQLITE_FCNTL_SYNC_OMITTED 8
    966#define SQLITE_FCNTL_WIN32_AV_RETRY 9
    967#define SQLITE_FCNTL_PERSIST_WAL 10
    968#define SQLITE_FCNTL_OVERWRITE 11
    969#define SQLITE_FCNTL_VFSNAME 12
    970#define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13
    971#define SQLITE_FCNTL_PRAGMA 14
    972#define SQLITE_FCNTL_BUSYHANDLER 15
    973#define SQLITE_FCNTL_TEMPFILENAME 16
    974#define SQLITE_FCNTL_MMAP_SIZE 18
    975#define SQLITE_FCNTL_TRACE 19
    976#define SQLITE_FCNTL_HAS_MOVED 20
    977#define SQLITE_FCNTL_SYNC 21
    978#define SQLITE_FCNTL_COMMIT_PHASETWO 22
    979#define SQLITE_FCNTL_WIN32_SET_HANDLE 23
    929
    930/*
    931** CAPI3REF: Mutex Handle
    932**
    933** The mutex module within SQLite defines [sqlite3_mutex] to be an
    934** abstract type for a mutex object. The SQLite core never looks
    935** at the internal representation of an [sqlite3_mutex]. It only
    936** deals with pointers to the [sqlite3_mutex] object.

    --- 428 unchanged lines hidden (view full) ---

    1365** The xRoundup method returns what would be the allocated size of
    1366** a memory allocation given a particular requested size. Most memory
    1367** allocators round up memory allocations at least to the next multiple
    1368** of 8. Some allocators round up to a larger multiple or to a power of 2.
    1369** Every memory allocation request coming in through [sqlite3_malloc()]
    1370** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0,
    1371** that causes the corresponding memory allocation to fail.
    1372**
    980
    981/*
    982** CAPI3REF: Mutex Handle
    983**
    984** The mutex module within SQLite defines [sqlite3_mutex] to be an
    985** abstract type for a mutex object. The SQLite core never looks
    986** at the internal representation of an [sqlite3_mutex]. It only
    987** deals with pointers to the [sqlite3_mutex] object.

    --- 428 unchanged lines hidden (view full) ---

    1416** The xRoundup method returns what would be the allocated size of
    1417** a memory allocation given a particular requested size. Most memory
    1418** allocators round up memory allocations at least to the next multiple
    1419** of 8. Some allocators round up to a larger multiple or to a power of 2.
    1420** Every memory allocation request coming in through [sqlite3_malloc()]
    1421** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0,
    1422** that causes the corresponding memory allocation to fail.
    1423**
    1373** The xInit method initializes the memory allocator. (For example,
    1424** The xInit method initializes the memory allocator. For example,
    1374** it might allocate any require mutexes or initialize internal data
    1375** structures. The xShutdown method is invoked (indirectly) by
    1376** [sqlite3_shutdown()] and should deallocate any resources acquired
    1377** by xInit. The pAppData pointer is used as the only parameter to
    1378** xInit and xShutdown.
    1379**
    1380** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
    1381** the xInit method, so the xInit method need not be threadsafe. The

    --- 225 unchanged lines hidden (view full) ---

    1607** [extended result code]. ^The third parameter passed to the logger is
    1608** log message after formatting via [sqlite3_snprintf()].
    1609** The SQLite logging interface is not reentrant; the logger function
    1610** supplied by the application must not invoke any SQLite interface.
    1611** In a multi-threaded application, the application-defined logger
    1612** function must be threadsafe. </dd>
    1613**
    1614** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
    1425** it might allocate any require mutexes or initialize internal data
    1426** structures. The xShutdown method is invoked (indirectly) by
    1427** [sqlite3_shutdown()] and should deallocate any resources acquired
    1428** by xInit. The pAppData pointer is used as the only parameter to
    1429** xInit and xShutdown.
    1430**
    1431** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
    1432** the xInit method, so the xInit method need not be threadsafe. The

    --- 225 unchanged lines hidden (view full) ---

    1658** [extended result code]. ^The third parameter passed to the logger is
    1659** log message after formatting via [sqlite3_snprintf()].
    1660** The SQLite logging interface is not reentrant; the logger function
    1661** supplied by the application must not invoke any SQLite interface.
    1662** In a multi-threaded application, the application-defined logger
    1663** function must be threadsafe. </dd>
    1664**
    1665** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
    1615** <dd> This option takes a single argument of type int. If non-zero, then
    1666** <dd>^(This option takes a single argument of type int. If non-zero, then
    1616** URI handling is globally enabled. If the parameter is zero, then URI handling
    1667** URI handling is globally enabled. If the parameter is zero, then URI handling
    1617** is globally disabled. If URI handling is globally enabled, all filenames
    1668** is globally disabled.)^ ^If URI handling is globally enabled, all filenames
    1618** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
    1619** specified as part of [ATTACH] commands are interpreted as URIs, regardless
    1620** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
    1669** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
    1670** specified as part of [ATTACH] commands are interpreted as URIs, regardless
    1671** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
    1621** connection is opened. If it is globally disabled, filenames are
    1672** connection is opened. ^If it is globally disabled, filenames are
    1622** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
    1673** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
    1623** database connection is opened. By default, URI handling is globally
    1674** database connection is opened. ^(By default, URI handling is globally
    1624** disabled. The default value may be changed by compiling with the
    1675** disabled. The default value may be changed by compiling with the
    1625** [SQLITE_USE_URI] symbol defined.
    1676** [SQLITE_USE_URI] symbol defined.)^
    1626**
    1627** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
    1677**
    1678** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
    1628** <dd> This option takes a single integer argument which is interpreted as
    1679** <dd>^This option takes a single integer argument which is interpreted as
    1629** a boolean in order to enable or disable the use of covering indices for
    1680** a boolean in order to enable or disable the use of covering indices for
    1630** full table scans in the query optimizer. The default setting is determined
    1681** full table scans in the query optimizer. ^The default setting is determined
    1631** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
    1632** if that compile-time option is omitted.
    1633** The ability to disable the use of covering indices for full table scans
    1634** is because some incorrectly coded legacy applications might malfunction
    1682** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
    1683** if that compile-time option is omitted.
    1684** The ability to disable the use of covering indices for full table scans
    1685** is because some incorrectly coded legacy applications might malfunction
    1635** malfunction when the optimization is enabled. Providing the ability to
    1686** when the optimization is enabled. Providing the ability to
    1636** disable the optimization allows the older, buggy application code to work
    1637** without change even with newer versions of SQLite.
    1638**
    1639** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
    1640** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
    1641** <dd> These options are obsolete and should not be used by new code.
    1642** They are retained for backwards compatibility but are now no-ops.
    1643** </dd>

    --- 12 unchanged lines hidden (view full) ---

    1656** points to has just been executed. Or, if the fourth parameter is 2, then
    1657** the connection being passed as the second parameter is being closed. The
    1658** third parameter is passed NULL In this case. An example of using this
    1659** configuration option can be seen in the "test_sqllog.c" source file in
    1660** the canonical SQLite source tree.</dd>
    1661**
    1662** [[SQLITE_CONFIG_MMAP_SIZE]]
    1663** <dt>SQLITE_CONFIG_MMAP_SIZE
    1687** disable the optimization allows the older, buggy application code to work
    1688** without change even with newer versions of SQLite.
    1689**
    1690** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
    1691** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
    1692** <dd> These options are obsolete and should not be used by new code.
    1693** They are retained for backwards compatibility but are now no-ops.
    1694** </dd>

    --- 12 unchanged lines hidden (view full) ---

    1707** points to has just been executed. Or, if the fourth parameter is 2, then
    1708** the connection being passed as the second parameter is being closed. The
    1709** third parameter is passed NULL In this case. An example of using this
    1710** configuration option can be seen in the "test_sqllog.c" source file in
    1711** the canonical SQLite source tree.</dd>
    1712**
    1713** [[SQLITE_CONFIG_MMAP_SIZE]]
    1714** <dt>SQLITE_CONFIG_MMAP_SIZE
    1664**
    SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
    1715** <dd>^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
    1665** that are the default mmap size limit (the default setting for
    1666** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
    1716** that are the default mmap size limit (the default setting for
    1717** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
    1667** The default setting can be overridden by each database connection using
    1718** ^The default setting can be overridden by each database connection using
    1668** either the [PRAGMA mmap_size] command, or by using the
    1719** either the [PRAGMA mmap_size] command, or by using the
    1669** [SQLITE_FCNTL_MMAP_SIZE] file control. The maximum allowed mmap size
    1720** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size
    1670** cannot be changed at run-time. Nor may the maximum allowed mmap size
    1671** exceed the compile-time maximum mmap size set by the
    1721** cannot be changed at run-time. Nor may the maximum allowed mmap size
    1722** exceed the compile-time maximum mmap size set by the
    1672** [SQLITE_MAX_MMAP_SIZE] compile-time option.
    1673** If either argument to this option is negative, then that argument is
    1723** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
    1724** ^If either argument to this option is negative, then that argument is
    1674** changed to its compile-time default.
    1725** changed to its compile-time default.
    1726**
    1727** [[SQLITE_CONFIG_WIN32_HEAPSIZE]]
    1728** <dt>SQLITE_CONFIG_WIN32_HEAPSIZE
    1729** <dd>^This option is only available if SQLite is compiled for Windows
    1730** with the [SQLITE_WIN32_MALLOC] pre-processor macro defined.
    1731** SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value
    1732** that specifies the maximum size of the created heap.
    1675** </dl>
    1676*/
    1677#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
    1678#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */
    1679#define SQLITE_CONFIG_SERIALIZED 3 /* nil */
    1680#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */
    1681#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */
    1682#define SQLITE_CONFIG_SCRATCH 6 /* void*, int sz, int N */

    --- 8 unchanged lines hidden (view full) ---

    1691#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */
    1692#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */
    1693#define SQLITE_CONFIG_URI 17 /* int */
    1694#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */
    1695#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
    1696#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
    1697#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
    1698#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
    1733** </dl>
    1734*/
    1735#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
    1736#define SQLITE_CONFIG_MULTITHREAD 2 /* nil */
    1737#define SQLITE_CONFIG_SERIALIZED 3 /* nil */
    1738#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */
    1739#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */
    1740#define SQLITE_CONFIG_SCRATCH 6 /* void*, int sz, int N */

    --- 8 unchanged lines hidden (view full) ---

    1749#define SQLITE_CONFIG_GETPCACHE 15 /* no-op */
    1750#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */
    1751#define SQLITE_CONFIG_URI 17 /* int */
    1752#define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */
    1753#define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
    1754#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
    1755#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
    1756#define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
    1757#define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
    1699
    1700/*
    1701** CAPI3REF: Database Connection Configuration Options
    1702**
    1703** These constants are the available integer configuration options that
    1704** can be passed as the second argument to the [sqlite3_db_config()] interface.
    1705**
    1706** New configuration options may be added in future releases of SQLite.

    --- 60 unchanged lines hidden (view full) ---

    1767** [extended result codes] feature of SQLite. ^The extended result
    1768** codes are disabled by default for historical compatibility.
    1769*/
    1770SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
    1771
    1772/*
    1773** CAPI3REF: Last Insert Rowid
    1774**
    1758
    1759/*
    1760** CAPI3REF: Database Connection Configuration Options
    1761**
    1762** These constants are the available integer configuration options that
    1763** can be passed as the second argument to the [sqlite3_db_config()] interface.
    1764**
    1765** New configuration options may be added in future releases of SQLite.

    --- 60 unchanged lines hidden (view full) ---

    1826** [extended result codes] feature of SQLite. ^The extended result
    1827** codes are disabled by default for historical compatibility.
    1828*/
    1829SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);
    1830
    1831/*
    1832** CAPI3REF: Last Insert Rowid
    1833**
    1775** ^Each entry in an SQLite table has a unique 64-bit signed
    1834** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
    1835** has a unique 64-bit signed
    1776** integer key called the [ROWID | "rowid"]. ^The rowid is always available
    1777** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
    1778** names are not also used by explicitly declared columns. ^If
    1779** the table has a column of type [INTEGER PRIMARY KEY] then that column
    1780** is another alias for the rowid.
    1781**
    1836** integer key called the [ROWID | "rowid"]. ^The rowid is always available
    1837** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
    1838** names are not also used by explicitly declared columns. ^If
    1839** the table has a column of type [INTEGER PRIMARY KEY] then that column
    1840** is another alias for the rowid.
    1841**
    1782** ^This routine returns the [rowid] of the most recent
    1783** successful [INSERT] into the database from the [database connection]
    1784** in the first argument. ^As of SQLite version 3.7.7, this routines
    1785** records the last insert rowid of both ordinary tables and [virtual tables].
    1786** ^If no successful [INSERT]s
    1787** have ever occurred on that database connection, zero is returned.
    1842** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the
    1843** most recent successful [INSERT] into a rowid table or [virtual table]
    1844** on database connection D.
    1845** ^Inserts into [WITHOUT ROWID] tables are not recorded.
    1846** ^If no successful [INSERT]s into rowid tables
    1847** have ever occurred on the database connection D,
    1848** then sqlite3_last_insert_rowid(D) returns zero.
    1788**
    1789** ^(If an [INSERT] occurs within a trigger or within a [virtual table]
    1790** method, then this routine will return the [rowid] of the inserted
    1791** row as long as the trigger or virtual table method is running.
    1792** But once the trigger or virtual table method ends, the value returned
    1793** by this routine reverts to what it was before the trigger or virtual
    1794** table method began.)^
    1795**

    --- 549 unchanged lines hidden (view full) ---

    2345**
    2346** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
    2347** select random [ROWID | ROWIDs] when inserting new records into a table that
    2348** already uses the largest possible [ROWID]. The PRNG is also used for
    2349** the build-in random() and randomblob() SQL functions. This interface allows
    2350** applications to access the same PRNG for other purposes.
    2351**
    2352** ^A call to this routine stores N bytes of randomness into buffer P.
    1849**
    1850** ^(If an [INSERT] occurs within a trigger or within a [virtual table]
    1851** method, then this routine will return the [rowid] of the inserted
    1852** row as long as the trigger or virtual table method is running.
    1853** But once the trigger or virtual table method ends, the value returned
    1854** by this routine reverts to what it was before the trigger or virtual
    1855** table method began.)^
    1856**

    --- 549 unchanged lines hidden (view full) ---

    2406**
    2407** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
    2408** select random [ROWID | ROWIDs] when inserting new records into a table that
    2409** already uses the largest possible [ROWID]. The PRNG is also used for
    2410** the build-in random() and randomblob() SQL functions. This interface allows
    2411** applications to access the same PRNG for other purposes.
    2412**
    2413** ^A call to this routine stores N bytes of randomness into buffer P.
    2414** ^If N is less than one, then P can be a NULL pointer.
    2353**
    2415**
    2354** ^The first time this routine is invoked (either internally or by
    2355** the application) the PRNG is seeded using randomness obtained
    2356** from the xRandomness method of the default [sqlite3_vfs] object.
    2357** ^On all subsequent invocations, the pseudo-randomness is generated
    2416** ^If this routine has not been previously called or if the previous
    2417** call had N less than one, then the PRNG is seeded using randomness
    2418** obtained from the xRandomness method of the default [sqlite3_vfs] object.
    2419** ^If the previous call to this routine had an N of 1 or more then
    2420** the pseudo-randomness is generated
    2358** internally and without recourse to the [sqlite3_vfs] xRandomness
    2359** method.
    2360*/
    2361SQLITE_API void sqlite3_randomness(int N, void *P);
    2362
    2363/*
    2364** CAPI3REF: Compile-Time Authorization Callbacks
    2365**

    --- 143 unchanged lines hidden (view full) ---

    2509#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
    2510#define SQLITE_REINDEX 27 /* Index Name NULL */
    2511#define SQLITE_ANALYZE 28 /* Table Name NULL */
    2512#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
    2513#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
    2514#define SQLITE_FUNCTION 31 /* NULL Function Name */
    2515#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
    2516#define SQLITE_COPY 0 /* No longer used */
    2421** internally and without recourse to the [sqlite3_vfs] xRandomness
    2422** method.
    2423*/
    2424SQLITE_API void sqlite3_randomness(int N, void *P);
    2425
    2426/*
    2427** CAPI3REF: Compile-Time Authorization Callbacks
    2428**

    --- 143 unchanged lines hidden (view full) ---

    2572#define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */
    2573#define SQLITE_REINDEX 27 /* Index Name NULL */
    2574#define SQLITE_ANALYZE 28 /* Table Name NULL */
    2575#define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */
    2576#define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
    2577#define SQLITE_FUNCTION 31 /* NULL Function Name */
    2578#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
    2579#define SQLITE_COPY 0 /* No longer used */
    2580#define SQLITE_RECURSIVE 33 /* NULL NULL */
    2517
    2518/*
    2519** CAPI3REF: Tracing And Profiling Functions
    2520**
    2521** These routines register callback functions that can be used for
    2522** tracing and profiling the execution of SQL statements.
    2523**
    2524** ^The callback function registered by sqlite3_trace() is invoked at

    --- 27 unchanged lines hidden (view full) ---

    2552**
    2553** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
    2554** function X to be invoked periodically during long running calls to
    2555** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
    2556** database connection D. An example use for this
    2557** interface is to keep a GUI updated during a large query.
    2558**
    2559** ^The parameter P is passed through as the only parameter to the
    2581
    2582/*
    2583** CAPI3REF: Tracing And Profiling Functions
    2584**
    2585** These routines register callback functions that can be used for
    2586** tracing and profiling the execution of SQL statements.
    2587**
    2588** ^The callback function registered by sqlite3_trace() is invoked at

    --- 27 unchanged lines hidden (view full) ---

    2616**
    2617** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
    2618** function X to be invoked periodically during long running calls to
    2619** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
    2620** database connection D. An example use for this
    2621** interface is to keep a GUI updated during a large query.
    2622**
    2623** ^The parameter P is passed through as the only parameter to the
    2560** callback function X. ^The parameter N is the number of
    2624** callback function X. ^The parameter N is the approximate number of
    2561** [virtual machine instructions] that are evaluated between successive
    2625** [virtual machine instructions] that are evaluated between successive
    2562** invocations of the callback X.
    2626** invocations of the callback X. ^If N is less than one then the progress
    2627** handler is disabled.
    2563**
    2564** ^Only a single progress handler may be defined at one time per
    2565** [database connection]; setting a new progress handler cancels the
    2566** old one. ^Setting parameter X to NULL disables the progress handler.
    2567** ^The progress handler is also disabled by setting N to a value less
    2568** than 1.
    2569**
    2570** ^If the progress callback returns non-zero, the operation is

    --- 149 unchanged lines hidden (view full) ---

    2720** <li> <b>cache</b>: ^The cache parameter may be set to either "shared" or
    2721** "private". ^Setting it to "shared" is equivalent to setting the
    2722** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to
    2723** sqlite3_open_v2(). ^Setting the cache parameter to "private" is
    2724** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
    2725** ^If sqlite3_open_v2() is used and the "cache" parameter is present in
    2726** a URI filename, its value overrides any behavior requested by setting
    2727** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
    2628**
    2629** ^Only a single progress handler may be defined at one time per
    2630** [database connection]; setting a new progress handler cancels the
    2631** old one. ^Setting parameter X to NULL disables the progress handler.
    2632** ^The progress handler is also disabled by setting N to a value less
    2633** than 1.
    2634**
    2635** ^If the progress callback returns non-zero, the operation is

    --- 149 unchanged lines hidden (view full) ---

    2785** <li> <b>cache</b>: ^The cache parameter may be set to either "shared" or
    2786** "private". ^Setting it to "shared" is equivalent to setting the
    2787** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to
    2788** sqlite3_open_v2(). ^Setting the cache parameter to "private" is
    2789** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
    2790** ^If sqlite3_open_v2() is used and the "cache" parameter is present in
    2791** a URI filename, its value overrides any behavior requested by setting
    2792** SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
    2793**
    2794** <li> <b>psow</b>: ^The psow parameter may be "true" (or "on" or "yes" or
    2795** "1") or "false" (or "off" or "no" or "0") to indicate that the
    2796** [powersafe overwrite] property does or does not apply to the
    2797** storage media on which the database file resides. ^The psow query
    2798** parameter only works for the built-in unix and Windows VFSes.
    2799**
    2800** <li> <b>nolock</b>: ^The nolock parameter is a boolean query parameter
    2801** which if set disables file locking in rollback journal modes. This
    2802** is useful for accessing a database on a filesystem that does not
    2803** support locking. Caution: Database corruption might result if two
    2804** or more processes write to the same database and any one of those
    2805** processes uses nolock=1.
    2806**
    2807** <li> <b>immutable</b>: ^The immutable parameter is a boolean query
    2808** parameter that indicates that the database file is stored on
    2809** read-only media. ^When immutable is set, SQLite assumes that the
    2810** database file cannot be changed, even by a process with higher
    2811** privilege, and so the database is opened read-only and all locking
    2812** and change detection is disabled. Caution: Setting the immutable
    2813** property on a database file that does in fact change can result
    2814** in incorrect query results and/or [SQLITE_CORRUPT] errors.
    2815** See also: [SQLITE_IOCAP_IMMUTABLE].
    2816**
    2728** </ul>
    2729**
    2730** ^Specifying an unknown parameter in the query component of a URI is not an
    2731** error. Future versions of SQLite might understand additional query
    2732** parameters. See "[query parameters with special meaning to SQLite]" for
    2733** additional information.
    2734**
    2735** [[URI filename examples]] <h3>URI filename examples</h3>

    --- 13 unchanged lines hidden (view full) ---

    2749** <td> Windows only: Open the file "data.db" on fred's desktop on drive
    2750** C:. Note that the %20 escaping in this example is not strictly
    2751** necessary - space characters can be used literally
    2752** in URI filenames.
    2753** <tr><td> file:data.db?mode=ro&cache=private <td>
    2754** Open file "data.db" in the current directory for read-only access.
    2755** Regardless of whether or not shared-cache mode is enabled by
    2756** default, use a private cache.
    2817** </ul>
    2818**
    2819** ^Specifying an unknown parameter in the query component of a URI is not an
    2820** error. Future versions of SQLite might understand additional query
    2821** parameters. See "[query parameters with special meaning to SQLite]" for
    2822** additional information.
    2823**
    2824** [[URI filename examples]] <h3>URI filename examples</h3>

    --- 13 unchanged lines hidden (view full) ---

    2838** <td> Windows only: Open the file "data.db" on fred's desktop on drive
    2839** C:. Note that the %20 escaping in this example is not strictly
    2840** necessary - space characters can be used literally
    2841** in URI filenames.
    2842** <tr><td> file:data.db?mode=ro&cache=private <td>
    2843** Open file "data.db" in the current directory for read-only access.
    2844** Regardless of whether or not shared-cache mode is enabled by
    2845** default, use a private cache.
    2757** <tr><td> file:/home/fred/data.db?vfs=unix-nolock <td>
    2758** Open file "/home/fred/data.db". Use the special VFS "unix-nolock".
    2846** <tr><td> file:/home/fred/data.db?vfs=unix-dotfile <td>
    2847** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile"
    2848** that uses dot-files in place of posix advisory locking.
    2759** <tr><td> file:data.db?mode=readonly <td>
    2760** An error. "readonly" is not a valid option for the "mode" parameter.
    2761** </table>
    2762**
    2763** ^URI hexadecimal escape sequences (%HH) are supported within the path and
    2764** query components of a URI. A hexadecimal escape sequence consists of a
    2765** percent sign - "%" - followed by exactly two hexadecimal digits
    2766** specifying an octet value. ^Before the path or query components of a

    --- 321 unchanged lines hidden (view full) ---

    3088** WHERE clause might influence the choice of query plan for a statement,
    3089** then the statement will be automatically recompiled, as if there had been
    3090** a schema change, on the first [sqlite3_step()] call following any change
    3091** to the [sqlite3_bind_text | bindings] of that [parameter].
    3092** ^The specific value of WHERE-clause [parameter] might influence the
    3093** choice of query plan if the parameter is the left-hand side of a [LIKE]
    3094** or [GLOB] operator or if the parameter is compared to an indexed column
    3095** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
    2849** <tr><td> file:data.db?mode=readonly <td>
    2850** An error. "readonly" is not a valid option for the "mode" parameter.
    2851** </table>
    2852**
    2853** ^URI hexadecimal escape sequences (%HH) are supported within the path and
    2854** query components of a URI. A hexadecimal escape sequence consists of a
    2855** percent sign - "%" - followed by exactly two hexadecimal digits
    2856** specifying an octet value. ^Before the path or query components of a

    --- 321 unchanged lines hidden (view full) ---

    3178** WHERE clause might influence the choice of query plan for a statement,
    3179** then the statement will be automatically recompiled, as if there had been
    3180** a schema change, on the first [sqlite3_step()] call following any change
    3181** to the [sqlite3_bind_text | bindings] of that [parameter].
    3182** ^The specific value of WHERE-clause [parameter] might influence the
    3183** choice of query plan if the parameter is the left-hand side of a [LIKE]
    3184** or [GLOB] operator or if the parameter is compared to an indexed column
    3185** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
    3096** the
    3097** </li>
    3098** </ol>
    3099*/
    3100SQLITE_API int sqlite3_prepare(
    3101 sqlite3 *db, /* Database handle */
    3102 const char *zSql, /* SQL statement, UTF-8 encoded */
    3103 int nByte, /* Maximum length of zSql in bytes. */
    3104 sqlite3_stmt **ppStmt, /* OUT: Statement handle */

    --- 645 unchanged lines hidden (view full) ---

    3750** that are applied:
    3751**
    3752** <blockquote>
    3753** <table border="1">
    3754** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
    3755**
    3756** <tr><td> NULL <td> INTEGER <td> Result is 0
    3757** <tr><td> NULL <td> FLOAT <td> Result is 0.0
    3186** </li>
    3187** </ol>
    3188*/
    3189SQLITE_API int sqlite3_prepare(
    3190 sqlite3 *db, /* Database handle */
    3191 const char *zSql, /* SQL statement, UTF-8 encoded */
    3192 int nByte, /* Maximum length of zSql in bytes. */
    3193 sqlite3_stmt **ppStmt, /* OUT: Statement handle */

    --- 645 unchanged lines hidden (view full) ---

    3839** that are applied:
    3840**
    3841** <blockquote>
    3842** <table border="1">
    3843** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
    3844**
    3845** <tr><td> NULL <td> INTEGER <td> Result is 0
    3846** <tr><td> NULL <td> FLOAT <td> Result is 0.0
    3758**
    NULL TEXT Result is NULL pointer
    3759**
    NULL BLOB Result is NULL pointer
    3847** <tr><td> NULL <td> TEXT <td> Result is a NULL pointer
    3848** <tr><td> NULL <td> BLOB <td> Result is a NULL pointer
    3760** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
    3761** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
    3762** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
    3849** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
    3850** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
    3851** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
    3763** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer
    3852** <tr><td> FLOAT <td> INTEGER <td> [CAST] to INTEGER
    3764** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
    3853** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
    3765** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT
    3766** <tr><td> TEXT <td> INTEGER <td> Use atoi()
    3767** <tr><td> TEXT <td> FLOAT <td> Use atof()
    3854** <tr><td> FLOAT <td> BLOB <td> [CAST] to BLOB
    3855** <tr><td> TEXT <td> INTEGER <td> [CAST] to INTEGER
    3856** <tr><td> TEXT <td> FLOAT <td> [CAST] to REAL
    3768** <tr><td> TEXT <td> BLOB <td> No change
    3857** <tr><td> TEXT <td> BLOB <td> No change
    3769** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi()
    3770** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof()
    3858** <tr><td> BLOB <td> INTEGER <td> [CAST] to INTEGER
    3859** <tr><td> BLOB <td> FLOAT <td> [CAST] to REAL
    3771** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
    3772** </table>
    3773** </blockquote>)^
    3774**
    3775** The table above makes reference to standard C library functions atoi()
    3776** and atof(). SQLite does not really use these functions. It has its
    3777** own equivalent internal routines. The atoi() and atof() names are
    3778** used in the table for brevity and because they are familiar to most

    --- 39 unchanged lines hidden (view full) ---

    3818** to sqlite3_column_text() or sqlite3_column_blob() with calls to
    3819** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16()
    3820** with calls to sqlite3_column_bytes().
    3821**
    3822** ^The pointers returned are valid until a type conversion occurs as
    3823** described above, or until [sqlite3_step()] or [sqlite3_reset()] or
    3824** [sqlite3_finalize()] is called. ^The memory space used to hold strings
    3825** and BLOBs is freed automatically. Do <b>not</b> pass the pointers returned
    3860** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
    3861** </table>
    3862** </blockquote>)^
    3863**
    3864** The table above makes reference to standard C library functions atoi()
    3865** and atof(). SQLite does not really use these functions. It has its
    3866** own equivalent internal routines. The atoi() and atof() names are
    3867** used in the table for brevity and because they are familiar to most

    --- 39 unchanged lines hidden (view full) ---

    3907** to sqlite3_column_text() or sqlite3_column_blob() with calls to
    3908** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16()
    3909** with calls to sqlite3_column_bytes().
    3910**
    3911** ^The pointers returned are valid until a type conversion occurs as
    3912** described above, or until [sqlite3_step()] or [sqlite3_reset()] or
    3913** [sqlite3_finalize()] is called. ^The memory space used to hold strings
    3914** and BLOBs is freed automatically. Do <b>not</b> pass the pointers returned
    3826** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into
    3915** from [sqlite3_column_blob()], [sqlite3_column_text()], etc. into
    3827** [sqlite3_free()].
    3828**
    3829** ^(If a memory allocation error occurs during the evaluation of any
    3830** of these routines, a default value is returned. The default value
    3831** is either the integer 0, the floating point number 0.0, or a NULL
    3832** pointer. Subsequent calls to [sqlite3_errcode()] will return
    3833** [SQLITE_NOMEM].)^
    3834*/

    --- 92 unchanged lines hidden (view full) ---

    3927** aggregate takes. ^If this parameter is -1, then the SQL function or
    3928** aggregate may take any number of arguments between 0 and the limit
    3929** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third
    3930** parameter is less than -1 or greater than 127 then the behavior is
    3931** undefined.
    3932**
    3933** ^The fourth parameter, eTextRep, specifies what
    3934** [SQLITE_UTF8 | text encoding] this SQL function prefers for
    3916** [sqlite3_free()].
    3917**
    3918** ^(If a memory allocation error occurs during the evaluation of any
    3919** of these routines, a default value is returned. The default value
    3920** is either the integer 0, the floating point number 0.0, or a NULL
    3921** pointer. Subsequent calls to [sqlite3_errcode()] will return
    3922** [SQLITE_NOMEM].)^
    3923*/

    --- 92 unchanged lines hidden (view full) ---

    4016** aggregate takes. ^If this parameter is -1, then the SQL function or
    4017** aggregate may take any number of arguments between 0 and the limit
    4018** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third
    4019** parameter is less than -1 or greater than 127 then the behavior is
    4020** undefined.
    4021**
    4022** ^The fourth parameter, eTextRep, specifies what
    4023** [SQLITE_UTF8 | text encoding] this SQL function prefers for
    3935** its parameters. Every SQL function implementation must be able to work
    3936** with UTF-8, UTF-16le, or UTF-16be. But some implementations may be
    3937** more efficient with one encoding than another. ^An application may
    3938** invoke sqlite3_create_function() or sqlite3_create_function16() multiple
    3939** times with the same function but with different values of eTextRep.
    4024** its parameters. The application should set this parameter to
    4025** [SQLITE_UTF16LE] if the function implementation invokes
    4026** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the
    4027** implementation invokes [sqlite3_value_text16be()] on an input, or
    4028** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8]
    4029** otherwise. ^The same SQL function may be registered multiple times using
    4030** different preferred text encodings, with different implementations for
    4031** each encoding.
    3940** ^When multiple implementations of the same function are available, SQLite
    3941** will pick the one that involves the least amount of data conversion.
    4032** ^When multiple implementations of the same function are available, SQLite
    4033** will pick the one that involves the least amount of data conversion.
    3942** If there is only a single implementation which does not care what text
    3943** encoding is used, then the fourth argument should be [SQLITE_ANY].
    3944**
    4034**
    4035** ^The fourth parameter may optionally be ORed with [SQLITE_DETERMINISTIC]
    4036** to signal that the function will always return the same result given
    4037** the same inputs within a single SQL statement. Most SQL functions are
    4038** deterministic. The built-in [random()] SQL function is an example of a
    4039** function that is not deterministic. The SQLite query planner is able to
    4040** perform additional optimizations on deterministic functions, so use
    4041** of the [SQLITE_DETERMINISTIC] flag is recommended where possible.
    4042**
    3945** ^(The fifth parameter is an arbitrary pointer. The implementation of the
    3946** function can gain access to this pointer using [sqlite3_user_data()].)^
    3947**
    3948** ^The sixth, seventh and eighth parameters, xFunc, xStep and xFinal, are
    3949** pointers to C-language functions that implement the SQL function or
    3950** aggregate. ^A scalar SQL function requires an implementation of the xFunc
    3951** callback only; NULL pointers must be passed as the xStep and xFinal
    3952** parameters. ^An aggregate SQL function requires an implementation of xStep

    --- 68 unchanged lines hidden (view full) ---

    4021**
    4022** These constant define integer codes that represent the various
    4023** text encodings supported by SQLite.
    4024*/
    4025#define SQLITE_UTF8 1
    4026#define SQLITE_UTF16LE 2
    4027#define SQLITE_UTF16BE 3
    4028#define SQLITE_UTF16 4 /* Use native byte order */
    4043** ^(The fifth parameter is an arbitrary pointer. The implementation of the
    4044** function can gain access to this pointer using [sqlite3_user_data()].)^
    4045**
    4046** ^The sixth, seventh and eighth parameters, xFunc, xStep and xFinal, are
    4047** pointers to C-language functions that implement the SQL function or
    4048** aggregate. ^A scalar SQL function requires an implementation of the xFunc
    4049** callback only; NULL pointers must be passed as the xStep and xFinal
    4050** parameters. ^An aggregate SQL function requires an implementation of xStep

    --- 68 unchanged lines hidden (view full) ---

    4119**
    4120** These constant define integer codes that represent the various
    4121** text encodings supported by SQLite.
    4122*/
    4123#define SQLITE_UTF8 1
    4124#define SQLITE_UTF16LE 2
    4125#define SQLITE_UTF16BE 3
    4126#define SQLITE_UTF16 4 /* Use native byte order */
    4029#define SQLITE_ANY 5 /* sqlite3_create_function only */
    4127#define SQLITE_ANY 5 /* Deprecated */
    4030#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
    4031
    4032/*
    4128#define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */
    4129
    4130/*
    4131** CAPI3REF: Function Flags
    4132**
    4133** These constants may be ORed together with the
    4134** [SQLITE_UTF8 | preferred text encoding] as the fourth argument
    4135** to [sqlite3_create_function()], [sqlite3_create_function16()], or
    4136** [sqlite3_create_function_v2()].
    4137*/
    4138#define SQLITE_DETERMINISTIC 0x800
    4139
    4140/*
    4033** CAPI3REF: Deprecated Functions
    4034** DEPRECATED
    4035**
    4036** These functions are [deprecated]. In order to maintain
    4037** backwards compatibility with older code, these functions continue
    4038** to be supported. However, new applications should avoid
    4039** the use of these functions. To help encourage people to avoid
    4040** using these functions, we are not going to tell you what they do.

    --- 133 unchanged lines hidden (view full) ---

    4174** and [sqlite3_create_function16()] routines that originally
    4175** registered the application defined function.
    4176*/
    4177SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
    4178
    4179/*
    4180** CAPI3REF: Function Auxiliary Data
    4181**
    4141** CAPI3REF: Deprecated Functions
    4142** DEPRECATED
    4143**
    4144** These functions are [deprecated]. In order to maintain
    4145** backwards compatibility with older code, these functions continue
    4146** to be supported. However, new applications should avoid
    4147** the use of these functions. To help encourage people to avoid
    4148** using these functions, we are not going to tell you what they do.

    --- 133 unchanged lines hidden (view full) ---

    4282** and [sqlite3_create_function16()] routines that originally
    4283** registered the application defined function.
    4284*/
    4285SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
    4286
    4287/*
    4288** CAPI3REF: Function Auxiliary Data
    4289**
    4182** The following two functions may be used by scalar SQL functions to
    4290** These functions may be used by (non-aggregate) SQL functions to
    4183** associate metadata with argument values. If the same value is passed to
    4184** multiple invocations of the same SQL function during query execution, under
    4291** associate metadata with argument values. If the same value is passed to
    4292** multiple invocations of the same SQL function during query execution, under
    4185** some circumstances the associated metadata may be preserved. This may
    4186** be used, for example, to add a regular-expression matching scalar
    4187** function. The compiled version of the regular expression is stored as
    4188** metadata associated with the SQL value passed as the regular expression
    4189** pattern. The compiled regular expression can be reused on multiple
    4190** invocations of the same function so that the original pattern string
    4191** does not need to be recompiled on each invocation.
    4293** some circumstances the associated metadata may be preserved. An example
    4294** of where this might be useful is in a regular-expression matching
    4295** function. The compiled version of the regular expression can be stored as
    4296** metadata associated with the pattern string.
    4297** Then as long as the pattern string remains the same,
    4298** the compiled regular expression can be reused on multiple
    4299** invocations of the same function.
    4192**
    4193** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata
    4194** associated by the sqlite3_set_auxdata() function with the Nth argument
    4300**
    4301** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata
    4302** associated by the sqlite3_set_auxdata() function with the Nth argument
    4195** value to the application-defined function. ^If no metadata has been ever
    4196** been set for the Nth argument of the function, or if the corresponding
    4197** function parameter has changed since the meta-data was set,
    4198** then sqlite3_get_auxdata() returns a NULL pointer.
    4303** value to the application-defined function. ^If there is no metadata
    4304** associated with the function argument, this sqlite3_get_auxdata() interface
    4305** returns a NULL pointer.
    4199**
    4306**
    4200** ^The sqlite3_set_auxdata() interface saves the metadata
    4201** pointed to by its 3rd parameter as the metadata for the N-th
    4202** argument of the application-defined function. Subsequent
    4203** calls to sqlite3_get_auxdata() might return this data, if it has
    4204** not been destroyed.
    4205** ^If it is not NULL, SQLite will invoke the destructor
    4206** function given by the 4th parameter to sqlite3_set_auxdata() on
    4207** the metadata when the corresponding function parameter changes
    4208** or when the SQL statement completes, whichever comes first.
    4307** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th
    4308** argument of the application-defined function. ^Subsequent
    4309** calls to sqlite3_get_auxdata(C,N) return P from the most recent
    4310** sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or
    4311** NULL if the metadata has been discarded.
    4312** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
    4313** SQLite will invoke the destructor function X with parameter P exactly
    4314** once, when the metadata is discarded.
    4315** SQLite is free to discard the metadata at any time, including: <ul>
    4316** <li> when the corresponding function parameter changes, or
    4317** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
    4318** SQL statement, or
    4319** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
    4320** <li> during the original sqlite3_set_auxdata() call when a memory
    4321** allocation error occurs. </ul>)^
    4209**
    4322**
    4210** SQLite is free to call the destructor and drop metadata on any
    4211** parameter of any function at any time. ^The only guarantee is that
    4212** the destructor will be called before the metadata is dropped.
    4323** Note the last bullet in particular. The destructor X in
    4324** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
    4325** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
    4326** should be called near the end of the function implementation and the
    4327** function implementation should not make any use of P after
    4328** sqlite3_set_auxdata() has been called.
    4213**
    4214** ^(In practice, metadata is preserved between function calls for
    4329**
    4330** ^(In practice, metadata is preserved between function calls for
    4215** expressions that are constant at compile time. This includes literal
    4216** values and [parameters].)^
    4331** function parameters that are compile-time constants, including literal
    4332** values and [parameters] and expressions composed from the same.)^
    4217**
    4218** These routines must be called from the same thread in which
    4219** the SQL function is running.
    4220*/
    4221SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
    4222SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
    4223
    4224

    --- 288 unchanged lines hidden (view full) ---

    4513**
    4514** The code to implement this API is not available in the public release
    4515** of SQLite.
    4516*/
    4517SQLITE_API int sqlite3_key(
    4518 sqlite3 *db, /* Database to be rekeyed */
    4519 const void *pKey, int nKey /* The key */
    4520);
    4333**
    4334** These routines must be called from the same thread in which
    4335** the SQL function is running.
    4336*/
    4337SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
    4338SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
    4339
    4340

    --- 288 unchanged lines hidden (view full) ---

    4629**
    4630** The code to implement this API is not available in the public release
    4631** of SQLite.
    4632*/
    4633SQLITE_API int sqlite3_key(
    4634 sqlite3 *db, /* Database to be rekeyed */
    4635 const void *pKey, int nKey /* The key */
    4636);
    4637SQLITE_API int sqlite3_key_v2(
    4638 sqlite3 *db, /* Database to be rekeyed */
    4639 const char *zDbName, /* Name of the database */
    4640 const void *pKey, int nKey /* The key */
    4641);
    4521
    4522/*
    4523** Change the key on an open database. If the current database is not
    4524** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the
    4525** database is decrypted.
    4526**
    4527** The code to implement this API is not available in the public release
    4528** of SQLite.
    4529*/
    4530SQLITE_API int sqlite3_rekey(
    4531 sqlite3 *db, /* Database to be rekeyed */
    4532 const void *pKey, int nKey /* The new key */
    4533);
    4642
    4643/*
    4644** Change the key on an open database. If the current database is not
    4645** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the
    4646** database is decrypted.
    4647**
    4648** The code to implement this API is not available in the public release
    4649** of SQLite.
    4650*/
    4651SQLITE_API int sqlite3_rekey(
    4652 sqlite3 *db, /* Database to be rekeyed */
    4653 const void *pKey, int nKey /* The new key */
    4654);
    4655SQLITE_API int sqlite3_rekey_v2(
    4656 sqlite3 *db, /* Database to be rekeyed */
    4657 const char *zDbName, /* Name of the database */
    4658 const void *pKey, int nKey /* The new key */
    4659);
    4534
    4535/*
    4536** Specify the activation key for a SEE database. Unless
    4537** activated, none of the SEE routines will work.
    4538*/
    4539SQLITE_API void sqlite3_activate_see(
    4540 const char *zPassPhrase /* Activation phrase */
    4541);

    --- 235 unchanged lines hidden (view full) ---

    4777SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
    4778SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
    4779
    4780/*
    4781** CAPI3REF: Data Change Notification Callbacks
    4782**
    4783** ^The sqlite3_update_hook() interface registers a callback function
    4784** with the [database connection] identified by the first argument
    4660
    4661/*
    4662** Specify the activation key for a SEE database. Unless
    4663** activated, none of the SEE routines will work.
    4664*/
    4665SQLITE_API void sqlite3_activate_see(
    4666 const char *zPassPhrase /* Activation phrase */
    4667);

    --- 235 unchanged lines hidden (view full) ---

    4903SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);
    4904SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
    4905
    4906/*
    4907** CAPI3REF: Data Change Notification Callbacks
    4908**
    4909** ^The sqlite3_update_hook() interface registers a callback function
    4910** with the [database connection] identified by the first argument
    4785** to be invoked whenever a row is updated, inserted or deleted.
    4911** to be invoked whenever a row is updated, inserted or deleted in
    4912** a rowid table.
    4786** ^Any callback set by a previous call to this function
    4787** for the same database connection is overridden.
    4788**
    4789** ^The second argument is a pointer to the function to invoke when a
    4913** ^Any callback set by a previous call to this function
    4914** for the same database connection is overridden.
    4915**
    4916** ^The second argument is a pointer to the function to invoke when a
    4790** row is updated, inserted or deleted.
    4917** row is updated, inserted or deleted in a rowid table.
    4791** ^The first argument to the callback is a copy of the third argument
    4792** to sqlite3_update_hook().
    4793** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
    4794** or [SQLITE_UPDATE], depending on the operation that caused the callback
    4795** to be invoked.
    4796** ^The third and fourth arguments to the callback contain pointers to the
    4797** database and table name containing the affected row.
    4798** ^The final callback parameter is the [rowid] of the row.
    4799** ^In the case of an update, this is the [rowid] after the update takes place.
    4800**
    4801** ^(The update hook is not invoked when internal system tables are
    4802** modified (i.e. sqlite_master and sqlite_sequence).)^
    4918** ^The first argument to the callback is a copy of the third argument
    4919** to sqlite3_update_hook().
    4920** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
    4921** or [SQLITE_UPDATE], depending on the operation that caused the callback
    4922** to be invoked.
    4923** ^The third and fourth arguments to the callback contain pointers to the
    4924** database and table name containing the affected row.
    4925** ^The final callback parameter is the [rowid] of the row.
    4926** ^In the case of an update, this is the [rowid] after the update takes place.
    4927**
    4928** ^(The update hook is not invoked when internal system tables are
    4929** modified (i.e. sqlite_master and sqlite_sequence).)^
    4930** ^The update hook is not invoked when [WITHOUT ROWID] tables are modified.
    4803**
    4804** ^In the current implementation, the update hook
    4805** is not invoked when duplication rows are deleted because of an
    4806** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook
    4807** invoked when rows are deleted using the [truncate optimization].
    4808** The exceptions defined in this paragraph might change in a future
    4809** release of SQLite.
    4810**

    --- 65 unchanged lines hidden (view full) ---

    4876*/
    4877SQLITE_API int sqlite3_release_memory(int);
    4878
    4879/*
    4880** CAPI3REF: Free Memory Used By A Database Connection
    4881**
    4882** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
    4883** memory as possible from database connection D. Unlike the
    4931**
    4932** ^In the current implementation, the update hook
    4933** is not invoked when duplication rows are deleted because of an
    4934** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook
    4935** invoked when rows are deleted using the [truncate optimization].
    4936** The exceptions defined in this paragraph might change in a future
    4937** release of SQLite.
    4938**

    --- 65 unchanged lines hidden (view full) ---

    5004*/
    5005SQLITE_API int sqlite3_release_memory(int);
    5006
    5007/*
    5008** CAPI3REF: Free Memory Used By A Database Connection
    5009**
    5010** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap
    5011** memory as possible from database connection D. Unlike the
    4884** [sqlite3_release_memory()] interface, this interface is effect even
    4885** when then [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
    5012** [sqlite3_release_memory()] interface, this interface is in effect even
    5013** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is
    4886** omitted.
    4887**
    4888** See also: [sqlite3_release_memory()]
    4889*/
    4890SQLITE_API int sqlite3_db_release_memory(sqlite3*);
    4891
    4892/*
    4893** CAPI3REF: Impose A Limit On Heap Size

    --- 217 unchanged lines hidden (view full) ---

    5111** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any
    5112** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()],
    5113** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail.
    5114**
    5115** ^Calling sqlite3_auto_extension(X) with an entry point X that is already
    5116** on the list of automatic extensions is a harmless no-op. ^No entry point
    5117** will be called more than once for each database connection that is opened.
    5118**
    5014** omitted.
    5015**
    5016** See also: [sqlite3_release_memory()]
    5017*/
    5018SQLITE_API int sqlite3_db_release_memory(sqlite3*);
    5019
    5020/*
    5021** CAPI3REF: Impose A Limit On Heap Size

    --- 217 unchanged lines hidden (view full) ---

    5239** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns. ^If any
    5240** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()],
    5241** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail.
    5242**
    5243** ^Calling sqlite3_auto_extension(X) with an entry point X that is already
    5244** on the list of automatic extensions is a harmless no-op. ^No entry point
    5245** will be called more than once for each database connection that is opened.
    5246**
    5119** See also: [sqlite3_reset_auto_extension()].
    5247** See also: [sqlite3_reset_auto_extension()]
    5248** and [sqlite3_cancel_auto_extension()]
    5120*/
    5121SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
    5122
    5123/*
    5249*/
    5250SQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));
    5251
    5252/*
    5253** CAPI3REF: Cancel Automatic Extension Loading
    5254**
    5255** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the
    5256** initialization routine X that was registered using a prior call to
    5257** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)]
    5258** routine returns 1 if initialization routine X was successfully
    5259** unregistered and it returns 0 if X was not on the list of initialization
    5260** routines.
    5261*/
    5262SQLITE_API int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
    5263
    5264/*
    5124** CAPI3REF: Reset Automatic Extension Loading
    5125**
    5126** ^This interface disables all automatic extensions previously
    5127** registered using [sqlite3_auto_extension()].
    5128*/
    5129SQLITE_API void sqlite3_reset_auto_extension(void);
    5130
    5131/*

    --- 107 unchanged lines hidden (view full) ---

    5239** [xFilter] method.
    5240** ^[sqlite3_free()] is used to free idxPtr if and only if
    5241** needToFreeIdxPtr is true.
    5242**
    5243** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
    5244** the correct order to satisfy the ORDER BY clause so that no separate
    5245** sorting step is required.
    5246**
    5265** CAPI3REF: Reset Automatic Extension Loading
    5266**
    5267** ^This interface disables all automatic extensions previously
    5268** registered using [sqlite3_auto_extension()].
    5269*/
    5270SQLITE_API void sqlite3_reset_auto_extension(void);
    5271
    5272/*

    --- 107 unchanged lines hidden (view full) ---

    5380** [xFilter] method.
    5381** ^[sqlite3_free()] is used to free idxPtr if and only if
    5382** needToFreeIdxPtr is true.
    5383**
    5384** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
    5385** the correct order to satisfy the ORDER BY clause so that no separate
    5386** sorting step is required.
    5387**
    5247** ^The estimatedCost value is an estimate of the cost of doing the
    5248** particular lookup. A full scan of a table with N entries should have
    5249** a cost of N. A binary search of a table of N entries should have a
    5250** cost of approximately log(N).
    5388** ^The estimatedCost value is an estimate of the cost of a particular
    5389** strategy. A cost of N indicates that the cost of the strategy is similar
    5390** to a linear scan of an SQLite table with N rows. A cost of log(N)
    5391** indicates that the expense of the operation is similar to that of a
    5392** binary search on a unique indexed field of an SQLite table with N rows.
    5393**
    5394** ^The estimatedRows value is an estimate of the number of rows that
    5395** will be returned by the strategy.
    5396**
    5397** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info
    5398** structure for SQLite version 3.8.2. If a virtual table extension is
    5399** used with an SQLite version earlier than 3.8.2, the results of attempting
    5400** to read or write the estimatedRows field are undefined (but are likely
    5401** to included crashing the application). The estimatedRows field should
    5402** therefore only be used if [sqlite3_libversion_number()] returns a
    5403** value greater than or equal to 3008002.
    5251*/
    5252struct sqlite3_index_info {
    5253 /* Inputs */
    5254 int nConstraint; /* Number of entries in aConstraint */
    5255 struct sqlite3_index_constraint {
    5256 int iColumn; /* Column on left-hand side of constraint */
    5257 unsigned char op; /* Constraint operator */
    5258 unsigned char usable; /* True if this constraint is usable */

    --- 8 unchanged lines hidden (view full) ---

    5267 struct sqlite3_index_constraint_usage {
    5268 int argvIndex; /* if >0, constraint is part of argv to xFilter */
    5269 unsigned char omit; /* Do not code a test for this constraint */
    5270 } *aConstraintUsage;
    5271 int idxNum; /* Number used to identify the index */
    5272 char *idxStr; /* String, possibly obtained from sqlite3_malloc */
    5273 int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
    5274 int orderByConsumed; /* True if output is already ordered */
    5404*/
    5405struct sqlite3_index_info {
    5406 /* Inputs */
    5407 int nConstraint; /* Number of entries in aConstraint */
    5408 struct sqlite3_index_constraint {
    5409 int iColumn; /* Column on left-hand side of constraint */
    5410 unsigned char op; /* Constraint operator */
    5411 unsigned char usable; /* True if this constraint is usable */

    --- 8 unchanged lines hidden (view full) ---

    5420 struct sqlite3_index_constraint_usage {
    5421 int argvIndex; /* if >0, constraint is part of argv to xFilter */
    5422 unsigned char omit; /* Do not code a test for this constraint */
    5423 } *aConstraintUsage;
    5424 int idxNum; /* Number used to identify the index */
    5425 char *idxStr; /* String, possibly obtained from sqlite3_malloc */
    5426 int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
    5427 int orderByConsumed; /* True if output is already ordered */
    5275 double estimatedCost; /* Estimated cost of using this index */
    5428 double estimatedCost; /* Estimated cost of using this index */
    5429 /* Fields below are only available in SQLite 3.8.2 and later */
    5430 sqlite3_int64 estimatedRows; /* Estimated number of rows returned */
    5276};
    5277
    5278/*
    5279** CAPI3REF: Virtual Table Constraint Operator Codes
    5280**
    5281** These macros defined the allowed values for the
    5282** [sqlite3_index_info].aConstraint[].op field. Each value represents
    5283** an operator that is part of a constraint term in the wHERE clause of

    --- 187 unchanged lines hidden (view full) ---

    5471** rolled back by the expiration of the BLOB. Such changes will eventually
    5472** commit if the transaction continues to completion.)^
    5473**
    5474** ^Use the [sqlite3_blob_bytes()] interface to determine the size of
    5475** the opened blob. ^The size of a blob may not be changed by this
    5476** interface. Use the [UPDATE] SQL command to change the size of a
    5477** blob.
    5478**
    5431};
    5432
    5433/*
    5434** CAPI3REF: Virtual Table Constraint Operator Codes
    5435**
    5436** These macros defined the allowed values for the
    5437** [sqlite3_index_info].aConstraint[].op field. Each value represents
    5438** an operator that is part of a constraint term in the wHERE clause of

    --- 187 unchanged lines hidden (view full) ---

    5626** rolled back by the expiration of the BLOB. Such changes will eventually
    5627** commit if the transaction continues to completion.)^
    5628**
    5629** ^Use the [sqlite3_blob_bytes()] interface to determine the size of
    5630** the opened blob. ^The size of a blob may not be changed by this
    5631** interface. Use the [UPDATE] SQL command to change the size of a
    5632** blob.
    5633**
    5634** ^The [sqlite3_blob_open()] interface will fail for a [WITHOUT ROWID]
    5635** table. Incremental BLOB I/O is not possible on [WITHOUT ROWID] tables.
    5636**
    5479** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces
    5480** and the built-in [zeroblob] SQL function can be used, if desired,
    5481** to create an empty, zero-filled blob in which to read or write using
    5482** this interface.
    5483**
    5484** To avoid a resource leak, every open [BLOB handle] should eventually
    5485** be released by a call to [sqlite3_blob_close()].
    5486*/

    --- 507 unchanged lines hidden (view full) ---

    5994#define SQLITE_TESTCTRL_ASSERT 12
    5995#define SQLITE_TESTCTRL_ALWAYS 13
    5996#define SQLITE_TESTCTRL_RESERVE 14
    5997#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
    5998#define SQLITE_TESTCTRL_ISKEYWORD 16
    5999#define SQLITE_TESTCTRL_SCRATCHMALLOC 17
    6000#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
    6001#define SQLITE_TESTCTRL_EXPLAIN_STMT 19
    5637** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces
    5638** and the built-in [zeroblob] SQL function can be used, if desired,
    5639** to create an empty, zero-filled blob in which to read or write using
    5640** this interface.
    5641**
    5642** To avoid a resource leak, every open [BLOB handle] should eventually
    5643** be released by a call to [sqlite3_blob_close()].
    5644*/

    --- 507 unchanged lines hidden (view full) ---

    6152#define SQLITE_TESTCTRL_ASSERT 12
    6153#define SQLITE_TESTCTRL_ALWAYS 13
    6154#define SQLITE_TESTCTRL_RESERVE 14
    6155#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
    6156#define SQLITE_TESTCTRL_ISKEYWORD 16
    6157#define SQLITE_TESTCTRL_SCRATCHMALLOC 17
    6158#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
    6159#define SQLITE_TESTCTRL_EXPLAIN_STMT 19
    6002#define SQLITE_TESTCTRL_LAST 19
    6160#define SQLITE_TESTCTRL_NEVER_CORRUPT 20
    6161#define SQLITE_TESTCTRL_VDBE_COVERAGE 21
    6162#define SQLITE_TESTCTRL_BYTEORDER 22
    6163#define SQLITE_TESTCTRL_LAST 22
    6003
    6004/*
    6005** CAPI3REF: SQLite Runtime Status
    6006**
    6007** ^This interface is used to retrieve runtime status information
    6008** about the performance of SQLite, and optionally to reset various
    6009** highwater marks. ^The first argument is an integer code for
    6010** the specific parameter to measure. ^(Recognized integer codes

    --- 216 unchanged lines hidden (view full) ---

    6227** been written to disk. Specifically, the number of pages written to the
    6228** wal file in wal mode databases, or the number of pages written to the
    6229** database file in rollback mode databases. Any pages written as part of
    6230** transaction rollback or database recovery operations are not included.
    6231** If an IO or other error occurs while writing a page to disk, the effect
    6232** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The
    6233** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
    6234** </dd>
    6164
    6165/*
    6166** CAPI3REF: SQLite Runtime Status
    6167**
    6168** ^This interface is used to retrieve runtime status information
    6169** about the performance of SQLite, and optionally to reset various
    6170** highwater marks. ^The first argument is an integer code for
    6171** the specific parameter to measure. ^(Recognized integer codes

    --- 216 unchanged lines hidden (view full) ---

    6388** been written to disk. Specifically, the number of pages written to the
    6389** wal file in wal mode databases, or the number of pages written to the
    6390** database file in rollback mode databases. Any pages written as part of
    6391** transaction rollback or database recovery operations are not included.
    6392** If an IO or other error occurs while writing a page to disk, the effect
    6393** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The
    6394** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
    6395** </dd>
    6396**
    6397** [[SQLITE_DBSTATUS_DEFERRED_FKS]] ^(<dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt>
    6398** <dd>This parameter returns zero for the current value if and only if
    6399** all foreign key constraints (deferred or immediate) have been
    6400** resolved.)^ ^The highwater mark is always 0.
    6401** </dd>
    6235** </dl>
    6236*/
    6237#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
    6238#define SQLITE_DBSTATUS_CACHE_USED 1
    6239#define SQLITE_DBSTATUS_SCHEMA_USED 2
    6240#define SQLITE_DBSTATUS_STMT_USED 3
    6241#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4
    6242#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5
    6243#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6
    6244#define SQLITE_DBSTATUS_CACHE_HIT 7
    6245#define SQLITE_DBSTATUS_CACHE_MISS 8
    6246#define SQLITE_DBSTATUS_CACHE_WRITE 9
    6402** </dl>
    6403*/
    6404#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
    6405#define SQLITE_DBSTATUS_CACHE_USED 1
    6406#define SQLITE_DBSTATUS_SCHEMA_USED 2
    6407#define SQLITE_DBSTATUS_STMT_USED 3
    6408#define SQLITE_DBSTATUS_LOOKASIDE_HIT 4
    6409#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5
    6410#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6
    6411#define SQLITE_DBSTATUS_CACHE_HIT 7
    6412#define SQLITE_DBSTATUS_CACHE_MISS 8
    6413#define SQLITE_DBSTATUS_CACHE_WRITE 9
    6247#define SQLITE_DBSTATUS_MAX 9 /* Largest defined DBSTATUS */
    6414#define SQLITE_DBSTATUS_DEFERRED_FKS 10
    6415#define SQLITE_DBSTATUS_MAX 10 /* Largest defined DBSTATUS */
    6248
    6249
    6250/*
    6251** CAPI3REF: Prepared Statement Status
    6252**
    6253** ^(Each prepared statement maintains various
    6254** [SQLITE_STMTSTATUS counters] that measure the number
    6255** of times it has performed specific operations.)^ These counters can

    --- 37 unchanged lines hidden (view full) ---

    6293** improvement performance through careful use of indices.</dd>
    6294**
    6295** [[SQLITE_STMTSTATUS_AUTOINDEX]] <dt>SQLITE_STMTSTATUS_AUTOINDEX</dt>
    6296** <dd>^This is the number of rows inserted into transient indices that
    6297** were created automatically in order to help joins run faster.
    6298** A non-zero value in this counter may indicate an opportunity to
    6299** improvement performance by adding permanent indices that do not
    6300** need to be reinitialized each time the statement is run.</dd>
    6416
    6417
    6418/*
    6419** CAPI3REF: Prepared Statement Status
    6420**
    6421** ^(Each prepared statement maintains various
    6422** [SQLITE_STMTSTATUS counters] that measure the number
    6423** of times it has performed specific operations.)^ These counters can

    --- 37 unchanged lines hidden (view full) ---

    6461** improvement performance through careful use of indices.</dd>
    6462**
    6463** [[SQLITE_STMTSTATUS_AUTOINDEX]] <dt>SQLITE_STMTSTATUS_AUTOINDEX</dt>
    6464** <dd>^This is the number of rows inserted into transient indices that
    6465** were created automatically in order to help joins run faster.
    6466** A non-zero value in this counter may indicate an opportunity to
    6467** improvement performance by adding permanent indices that do not
    6468** need to be reinitialized each time the statement is run.</dd>
    6469**
    6470** [[SQLITE_STMTSTATUS_VM_STEP]] <dt>SQLITE_STMTSTATUS_VM_STEP</dt>
    6471** <dd>^This is the number of virtual machine operations executed
    6472** by the prepared statement if that number is less than or equal
    6473** to 2147483647. The number of virtual machine operations can be
    6474** used as a proxy for the total work done by the prepared statement.
    6475** If the number of virtual machine operations exceeds 2147483647
    6476** then the value returned by this statement status code is undefined.
    6477** </dd>
    6301** </dl>
    6302*/
    6303#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
    6304#define SQLITE_STMTSTATUS_SORT 2
    6305#define SQLITE_STMTSTATUS_AUTOINDEX 3
    6478** </dl>
    6479*/
    6480#define SQLITE_STMTSTATUS_FULLSCAN_STEP 1
    6481#define SQLITE_STMTSTATUS_SORT 2
    6482#define SQLITE_STMTSTATUS_AUTOINDEX 3
    6483#define SQLITE_STMTSTATUS_VM_STEP 4
    6306
    6307/*
    6308** CAPI3REF: Custom Page Cache Object
    6309**
    6310** The sqlite3_pcache type is opaque. It is implemented by
    6311** the pluggable module. The SQLite core has no knowledge of
    6312** its size or internal structure and never deals with the
    6313** sqlite3_pcache object except by holding and passing pointers

    --- 862 unchanged lines hidden (view full) ---

    7176*/
    7177#ifdef SQLITE_OMIT_FLOATING_POINT
    7178# undef double
    7179#endif
    7180
    7181#ifdef __cplusplus
    7182} /* End of the 'extern "C"' block */
    7183#endif
    6484
    6485/*
    6486** CAPI3REF: Custom Page Cache Object
    6487**
    6488** The sqlite3_pcache type is opaque. It is implemented by
    6489** the pluggable module. The SQLite core has no knowledge of
    6490** its size or internal structure and never deals with the
    6491** sqlite3_pcache object except by holding and passing pointers

    --- 862 unchanged lines hidden (view full) ---

    7354*/
    7355#ifdef SQLITE_OMIT_FLOATING_POINT
    7356# undef double
    7357#endif
    7358
    7359#ifdef __cplusplus
    7360} /* End of the 'extern "C"' block */
    7361#endif
    7184#endif
    7362#endif /* _SQLITE3_H_ */
    7185
    7186/*
    7187** 2010 August 30
    7188**
    7189** The author disclaims copyright to this source code. In place of
    7190** a legal notice, here is a blessing:
    7191**
    7192** May you do good and not evil.

    --- 7 unchanged lines hidden (view full) ---

    7200#define _SQLITE3RTREE_H_
    7201
    7202
    7203#ifdef __cplusplus
    7204extern "C" {
    7205#endif
    7206
    7207typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry;
    7363
    7364/*
    7365** 2010 August 30
    7366**
    7367** The author disclaims copyright to this source code. In place of
    7368** a legal notice, here is a blessing:
    7369**
    7370** May you do good and not evil.

    --- 7 unchanged lines hidden (view full) ---

    7378#define _SQLITE3RTREE_H_
    7379
    7380
    7381#ifdef __cplusplus
    7382extern "C" {
    7383#endif
    7384
    7385typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry;
    7386typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info;
    7208
    7387
    7388/* The double-precision datatype used by RTree depends on the
    7389** SQLITE_RTREE_INT_ONLY compile-time option.
    7390*/
    7391#ifdef SQLITE_RTREE_INT_ONLY
    7392 typedef sqlite3_int64 sqlite3_rtree_dbl;
    7393#else
    7394 typedef double sqlite3_rtree_dbl;
    7395#endif
    7396
    7209/*
    7210** Register a geometry callback named zGeom that can be used as part of an
    7211** R-Tree geometry query as follows:
    7212**
    7213** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
    7214*/
    7215SQLITE_API int sqlite3_rtree_geometry_callback(
    7216 sqlite3 *db,
    7217 const char *zGeom,
    7397/*
    7398** Register a geometry callback named zGeom that can be used as part of an
    7399** R-Tree geometry query as follows:
    7400**
    7401** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)
    7402*/
    7403SQLITE_API int sqlite3_rtree_geometry_callback(
    7404 sqlite3 *db,
    7405 const char *zGeom,
    7218#ifdef SQLITE_RTREE_INT_ONLY
    7219 int (*xGeom)(sqlite3_rtree_geometry*, int n, sqlite3_int64 *a, int *pRes),
    7220#else
    7221 int (*xGeom)(sqlite3_rtree_geometry*, int n, double *a, int *pRes),
    7222#endif
    7406 int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*),
    7223 void *pContext
    7224);
    7225
    7226
    7227/*
    7228** A pointer to a structure of the following type is passed as the first
    7229** argument to callbacks registered using rtree_geometry_callback().
    7230*/
    7231struct sqlite3_rtree_geometry {
    7232 void *pContext; /* Copy of pContext passed to s_r_g_c() */
    7233 int nParam; /* Size of array aParam[] */
    7407 void *pContext
    7408);
    7409
    7410
    7411/*
    7412** A pointer to a structure of the following type is passed as the first
    7413** argument to callbacks registered using rtree_geometry_callback().
    7414*/
    7415struct sqlite3_rtree_geometry {
    7416 void *pContext; /* Copy of pContext passed to s_r_g_c() */
    7417 int nParam; /* Size of array aParam[] */
    7234 double *aParam; /* Parameters passed to SQL geom function */
    7418 sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */
    7235 void *pUser; /* Callback implementation user data */
    7236 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
    7237};
    7238
    7419 void *pUser; /* Callback implementation user data */
    7420 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */
    7421};
    7422
    7423/*
    7424** Register a 2nd-generation geometry callback named zScore that can be
    7425** used as part of an R-Tree geometry query as follows:
    7426**
    7427** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...)
    7428*/
    7429SQLITE_API int sqlite3_rtree_query_callback(
    7430 sqlite3 *db,
    7431 const char *zQueryFunc,
    7432 int (*xQueryFunc)(sqlite3_rtree_query_info*),
    7433 void *pContext,
    7434 void (*xDestructor)(void*)
    7435);
    7239
    7436
    7437
    7438/*
    7439** A pointer to a structure of the following type is passed as the
    7440** argument to scored geometry callback registered using
    7441** sqlite3_rtree_query_callback().
    7442**
    7443** Note that the first 5 fields of this structure are identical to
    7444** sqlite3_rtree_geometry. This structure is a subclass of
    7445** sqlite3_rtree_geometry.
    7446*/
    7447struct sqlite3_rtree_query_info {
    7448 void *pContext; /* pContext from when function registered */
    7449 int nParam; /* Number of function parameters */
    7450 sqlite3_rtree_dbl *aParam; /* value of function parameters */
    7451 void *pUser; /* callback can use this, if desired */
    7452 void (*xDelUser)(void*); /* function to free pUser */
    7453 sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */
    7454 unsigned int *anQueue; /* Number of pending entries in the queue */
    7455 int nCoord; /* Number of coordinates */
    7456 int iLevel; /* Level of current node or entry */
    7457 int mxLevel; /* The largest iLevel value in the tree */
    7458 sqlite3_int64 iRowid; /* Rowid for current entry */
    7459 sqlite3_rtree_dbl rParentScore; /* Score of parent node */
    7460 int eParentWithin; /* Visibility of parent node */
    7461 int eWithin; /* OUT: Visiblity */
    7462 sqlite3_rtree_dbl rScore; /* OUT: Write the score here */
    7463};
    7464
    7465/*
    7466** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
    7467*/
    7468#define NOT_WITHIN 0 /* Object completely outside of query region */
    7469#define PARTLY_WITHIN 1 /* Object partially overlaps query region */
    7470#define FULLY_WITHIN 2 /* Object fully contained within query region */
    7471
    7472
    7240#ifdef __cplusplus
    7241} /* end of the 'extern "C"' block */
    7242#endif
    7243
    7244#endif /* ifndef _SQLITE3RTREE_H_ */
    7245
    7473#ifdef __cplusplus
    7474} /* end of the 'extern "C"' block */
    7475#endif
    7476
    7477#endif /* ifndef _SQLITE3RTREE_H_ */
    7478