Lines Matching full:sqlite
12 ** This header file defines the interface that the SQLite library
15 ** not a published API of SQLite, is subject to change without
16 ** notice, and should not be referenced by programs that use SQLite.
20 ** features recently added to SQLite. We do not anticipate changes
24 ** The official C-language API documentation for SQLite is derived
26 ** on how SQLite interfaces are suppose to operate.
28 ** The name of this file under configuration management is "sqlite.h.in".
87 ** evaluates to a string literal that is the SQLite version in the
93 ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
98 ** Since version 3.6.18, SQLite source code has been stored in the
101 ** a string which identifies a particular check-in of SQLite
180 ** SQLite was compiled with mutexing code omitted due to the
183 ** SQLite can be compiled with or without mutexes. When
185 ** are enabled and SQLite is threadsafe. When the
188 ** to use SQLite concurrently from more than one thread.
196 ** version of SQLite that it is linking against was compiled with
200 ** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with
218 ** Each open SQLite database is represented by a pointer to an instance of
235 ** SQLite includes typedefs for 64-bit signed and unsigned integers.
391 ** Many SQLite functions return an integer result code from the set shown
394 ** New error codes may be added in future versions of SQLite.
401 #define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */
436 ** In its default configuration, SQLite API routines return one of 30 integer
440 ** address this, newer versions of SQLite (version 3.3.8 and later) include
577 ** SQLite uses one of these integer values as the second
590 ** When SQLite invokes the xSync() method of an
607 ** only make a difference on Mac OSX for the default SQLite code.
610 ** operating systems natively supported by SQLite, only Mac OSX
677 ** about the status of a lock, or to break stale locks. The SQLite
767 ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
793 ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
796 ** because the user has configured SQLite with
807 ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
857 ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
899 ** file-control may be invoked by SQLite on the database file handle
911 ** to have SQLite generate a
930 ** to the VFS about what the higher layers of the SQLite stack are doing.
933 ** SQLite stack may generate instances of this file control if
976 ** The mutex module within SQLite defines [sqlite3_mutex] to be an
977 ** abstract type for a mutex object. The SQLite core never looks
989 ** the SQLite core and the underlying operating system. The "vfs"
994 ** future versions of SQLite. Additional fields may be appended to this
997 ** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
1012 ** structure that SQLite will ever modify. SQLite will only access
1021 ** ^SQLite guarantees that the zFilename parameter to xOpen
1027 ** ^SQLite further guarantees that
1044 ** ^(SQLite will also add one of the following flags to the xOpen()
1067 ** SQLite might also add one of the following flags to the xOpen method:
1088 ** ^At least szOsFile bytes of memory are allocated by SQLite
1094 ** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
1105 ** ^SQLite will always allocate at least mxPathname+1 bytes for the
1109 ** handled as a fatal error by SQLite, vfs implementations should endeavor
1125 ** ^SQLite will use the xCurrentTimeInt64() method to get the current
1131 ** are not used by the SQLite core. These optional interfaces are provided
1197 ** release of SQLite.
1201 ** SQLite.
1239 ** The SQLite core will never attempt to acquire or release a
1246 ** CAPI3REF: Initialize The SQLite Library
1249 ** SQLite library. ^The sqlite3_shutdown() routine
1253 ** SQLite normally do not need to invoke either of these routines.
1270 ** other SQLite resources must be deallocated prior to invoking
1283 ** SQLite interfaces so that an application usually does not need to
1285 ** calls sqlite3_initialize() so the SQLite library will be automatically
1287 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1290 ** prior to using any other SQLite interface. For maximum portability,
1292 ** directly prior to using any other SQLite interface. Future releases
1293 ** of SQLite may require this. In other words, the behavior exhibited
1294 ** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
1295 ** default behavior in some future release of SQLite.
1298 ** initialization of the SQLite library. The sqlite3_os_end()
1311 ** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
1326 ** CAPI3REF: Configuring The SQLite Library
1329 ** changes to SQLite in order to tune SQLite to the specific needs of
1335 ** must insure that no other SQLite interfaces are invoked by other
1346 ** what property of SQLite is to be configured. Subsequent arguments
1351 ** ^If the option is unknown or SQLite is unable to set the option
1377 ** An instance of this object defines the interface between SQLite
1380 ** This object is used in only one place in the SQLite interface.
1387 ** memory allocation subsystem for SQLite to use for all of its
1390 ** Note that SQLite comes with several [built-in memory allocators]
1394 ** also used during testing of SQLite in order to specify an alternative
1396 ** order to verify that SQLite recovers gracefully from such
1401 ** ^SQLite guarantees that the second argument to
1423 ** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
1426 ** not need to be threadsafe either. For all other methods, SQLite
1434 ** SQLite will never invoke xInit() more than once without an intervening
1456 ** New configuration options may be added in future releases of SQLite.
1467 ** all mutexing and puts SQLite into a mode where it can only be used
1468 ** by a single thread. ^If SQLite is compiled with
1481 ** are enabled so that SQLite will be safe to use in a multi-threaded
1483 ** [database connection] at the same time. ^If SQLite is compiled with
1494 ** In this mode (which is the default when SQLite is compiled with
1495 ** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
1499 ** ^If SQLite is compiled with
1509 ** the memory allocation routines built into SQLite.)^ ^SQLite makes
1525 ** following SQLite interfaces become non-operational:
1532 ** ^Memory allocation statistics are enabled by default unless SQLite is
1538 ** <dd> ^This option specifies a static memory buffer that SQLite can use for
1546 ** ^SQLite will use no more than two scratch buffers per thread. So
1548 ** ^SQLite will never require a scratch buffer that is more than 6
1549 ** times the database page size. ^If SQLite needs needs additional
1554 ** <dd> ^This option specifies a static memory buffer that SQLite can use for
1566 ** ^SQLite will use the memory provided by the first argument to satisfy its
1569 ** SQLite goes to [sqlite3_malloc()] for the additional storage space.
1571 ** be aligned to an 8-byte boundary or subsequent behavior of SQLite
1575 ** <dd> ^This option specifies a static memory buffer that SQLite will use
1580 ** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
1587 ** boundary or subsequent behavior of SQLite will be undefined.
1595 ** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the
1597 ** [sqlite3_config()] returns. ^If SQLite is compiled with
1610 ** profiling or testing, for example. ^If SQLite is compiled with
1629 ** to a custom page cache implementation.)^ ^SQLite makes a copy of the
1634 ** [sqlite3_pcache_methods2] object. SQLite copies of the current
1638 ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
1652 ** The SQLite logging interface is not reentrant; the logger function
1653 ** supplied by the application must not invoke any SQLite interface.
1680 ** without change even with newer versions of SQLite.
1690 ** <dd>This option is only available if sqlite is compiled with the
1703 ** the canonical SQLite source tree.</dd>
1721 ** <dd>^This option is only available if SQLite is compiled for Windows
1757 ** New configuration options may be added in future releases of SQLite.
1771 ** may be NULL in which case SQLite will allocate the
1818 ** [extended result codes] feature of SQLite. ^The extended result
1826 ** ^Each entry in most SQLite tables (except for [WITHOUT ROWID] tables)
1999 ** SQLite for parsing. ^These routines return 1 if the input string
2014 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
2055 ** when there is lock contention. ^If SQLite determines that invoking the busy
2066 ** SQLite returns [SQLITE_BUSY] for the first process, hoping that this
2176 ** to any internal data structures of SQLite. It uses only the public
2294 ** The SQLite core uses these three routines for all of its own
2339 ** In SQLite version 3.5.0 and 3.5.1, it was possible to define
2344 ** Prior to SQLite version 3.7.10, the Windows OS interface layer called
2346 ** filenames between the UTF-8 encoding used by SQLite
2368 ** SQLite provides these two interfaces for reporting on the status
2378 ** added by SQLite in its implementation of [sqlite3_malloc()],
2394 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
2504 ** to signal SQLite whether or not the action is permitted. See the
2592 ** digits in the time are meaningless. Future versions of SQLite
2595 ** subject to change in future versions of SQLite.
2637 ** ^These routines open an SQLite database file as specified by the
2642 ** if SQLite is unable to allocate memory to hold the [sqlite3] object,
2706 ** the database connection is closed. Future versions of SQLite might
2724 ** As of SQLite version 3.7.7, URI filename interpretation is turned off
2725 ** by default, but future releases of SQLite might enable URI filename
2735 ** ^SQLite uses the path component of the URI as the name of the disk file
2745 ** either by SQLite itself, or by a [VFS | custom VFS implementation].
2746 ** SQLite interprets the following three query parameters:
2796 ** read-only media. ^When immutable is set, SQLite assumes that the
2807 ** error. Future versions of SQLite might understand additional query
2808 ** parameters. See "[query parameters with special meaning to SQLite]" for
2863 sqlite3 **ppDb /* OUT: SQLite db handle */
2867 sqlite3 **ppDb /* OUT: SQLite db handle */
2871 sqlite3 **ppDb, /* OUT: SQLite db handle */
2911 ** is not a database file pathname pointer that SQLite passed into the xOpen
2937 ** subsequent calls to other SQLite interface functions.)^
3038 ** Additional information is available at [limits | Limits in SQLite].
3062 ** SQLite.</dd>)^
3119 ** the nul-terminator bytes as this saves SQLite from having to
3268 ** SQLite uses the sqlite3_value object to represent all values
3269 ** that can be stored in a database table. SQLite uses dynamic typing
3282 ** sqlite3_value object. If SQLite is compiled to be single-threaded
3284 ** or if SQLite is run in one of reduced mutex modes
3376 ** string after SQLite has finished with it. ^The destructor is called
3380 ** the special value [SQLITE_STATIC], then SQLite assumes that the
3383 ** SQLite makes its own private copy of the data immediately, before
3529 ** one release of SQLite to the next.
3564 ** ^As with all other SQLite APIs, those whose names end with "16" return
3608 ** ^SQLite uses dynamic run-time typing. ^So just because a column
3610 ** data stored in that column is of the declared type. SQLite is
3671 ** For all versions of SQLite up to and including 3.6.23.1, a call to
3721 ** ^(Every value in SQLite has one of five fundamental datatypes:
3733 ** Note that the SQLITE_TEXT constant was also used in SQLite version 2
3735 ** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not
3783 ** versions of SQLite may change the behavior of sqlite3_column_type()
3852 ** and atof(). SQLite does not really use these functions. It has its
4019 ** ^When multiple implementations of the same function are available, SQLite
4026 ** function that is not deterministic. The SQLite query planner is able to
4054 ** arguments or differing preferred text encodings. ^SQLite will use
4068 ** SQLite interfaces. However, such calls must not
4108 ** text encodings supported by SQLite.
4212 ** for a particular aggregate function, SQLite
4236 ** ^SQLite automatically frees the memory allocated by
4300 ** SQLite will invoke the destructor function X with parameter P exactly
4302 ** SQLite is free to discard the metadata at any time, including: <ul>
4336 ** the near future and that SQLite should make its own private copy of
4373 ** ^SQLite uses the string pointed to by the
4375 ** as the text of an error message. ^SQLite interprets the error
4376 ** message string from sqlite3_result_error() as UTF-8. ^SQLite
4379 ** or sqlite3_result_error16() is negative then SQLite takes as the error
4382 ** sqlite3_result_error16() is non-negative then SQLite takes that many
4389 ** returned by SQLite as a result of an error in a function. ^By default,
4393 ** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an
4396 ** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an
4414 ** ^SQLite takes the text result from the application from
4417 ** is negative, then SQLite takes result text from the 2nd parameter
4429 ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
4433 ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
4439 ** then SQLite makes a copy of the result into space obtained from
4505 ** with different eTextRep parameters and SQLite will use whichever
4531 ** collating function is registered and used, then the behavior of SQLite
4545 ** themselves rather than expecting SQLite to deal with it for them.
4546 ** This is different from every other SQLite interface. The inconsistency
4618 ** of SQLite.
4636 ** of SQLite.
4678 ** ^SQLite implements this interface by calling the xSleep()
4691 ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
4693 ** is a NULL pointer, then SQLite performs a search for an appropriate
4708 ** as part of process initialization and before any SQLite interface
4721 ** Except when requested by the [temp_store_directory pragma], SQLite
4750 ** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed
4752 ** pointer, then SQLite assumes that all database files specified
4765 ** as part of process initialization and before any SQLite interface
4795 ** find out whether SQLite automatically rolled back the transaction after
4936 ** release of SQLite.
4968 ** This is a change as of SQLite version 3.5.0. In prior versions of SQLite,
4980 ** future releases of SQLite. Applications that care about shared
4986 ** See Also: [SQLite Shared-Cache Mode]
5000 ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].
5023 ** soft limit on the amount of heap memory that may be allocated by SQLite.
5024 ** ^SQLite
5027 ** ^The soft heap limit is "soft" because even though SQLite strives to stay
5056 ** Beginning with SQLite version 3.7.3, the soft heap limit is enforced
5062 ** the page cache is the predominate memory user in SQLite, most
5066 ** The circumstances under which SQLite will enforce the soft heap limit may
5067 ** changes in future releases of SQLite.
5119 ** call to any SQLite API function.
5160 ** ^This interface loads an SQLite extension library from the named file.
5163 ** [SQLite extension] library contained in the file zFile. If
5171 ** ^(zProc may be 0, in which case SQLite will try to come up with an
5218 ** xEntryPoint() is the entry point for a statically linked [SQLite extension]
5222 ** no arguments and returns void, SQLite invokes xEntryPoint() with three
5236 ** and return an appropriate [error code]. ^SQLite ensures that *pzErrMsg
5237 ** is NULL before calling the xEntryPoint(). ^SQLite will invoke
5376 ** virtual table and is not checked again by SQLite.)^
5389 ** to a linear scan of an SQLite table with N rows. A cost of log(N)
5391 ** binary search on a unique indexed field of an SQLite table with N rows.
5397 ** structure for SQLite version 3.8.2. If a virtual table extension is
5398 ** used with an SQLite version earlier than 3.8.2, the results of attempting
5428 /* Fields below are only available in SQLite 3.8.2 and later */
5464 ** is a pointer to a destructor for the pClientData. ^SQLite will
5465 ** invoke the destructor function (if it is not NULL) when SQLite
5473 sqlite3 *db, /* SQLite connection to register module with */
5479 sqlite3 *db, /* SQLite connection to register module with */
5668 ** SQLite error code is returned and the blob handle is considered aborted.
5787 ** that SQLite uses to interact
5788 ** with the underlying operating system. Most SQLite builds come with a
5819 ** The SQLite core uses these routines for thread
5821 ** use by SQLite, code that links against SQLite is
5824 ** The SQLite source code contains multiple implementations
5827 ** implementations are available in the SQLite core:
5841 ** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
5851 ** that means that a mutex could not be allocated. ^SQLite
5874 ** not want to. ^SQLite will only request a recursive mutex in
5882 ** used by the current version of SQLite. Future versions of SQLite
5884 ** use by SQLite only. Applications that use SQLite mutexes should
5895 ** allocated dynamic mutex. ^SQLite is careful to deallocate every
5898 ** mutex results in undefined behavior. ^SQLite never deallocates
5911 ** SQLite will never exhibit
5916 ** will always return SQLITE_BUSY. The SQLite core only ever uses
5922 ** calling thread or is not currently allocated. SQLite will
5943 ** Usually, the default mutex implementations provided by SQLite are
5945 ** implementation for specialized deployments or systems for which SQLite
5955 ** ^The xMutexInit routine is called by SQLite exactly once for each
5992 ** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
5993 ** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory
5994 ** allocation for a static mutex. ^However xMutexAlloc() may use SQLite
5997 ** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
6019 ** are intended for use inside assert() statements. ^The SQLite core
6021 ** are advised to follow the lead of the core. ^The SQLite core only
6055 ** The set of static mutexes may change from one SQLite release to the
6122 ** state of SQLite and to inject faults into SQLite for testing
6127 ** for verifying the correct operation of the SQLite library. Depending
6128 ** on how the SQLite library is compiled, this interface might not exist.
6132 ** Unlike most of the SQLite API, this function is not guaranteed to
6171 ** CAPI3REF: SQLite Runtime Status
6174 ** about the performance of SQLite, and optionally to reset various
6191 ** called while other threads are running the same or different SQLite
6193 ** *pHighwater reflect the status of SQLite at different points in time
6214 ** and internal memory usage by the SQLite library. Scratch memory
6279 ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].</dd>)^
6305 ** to grow in future releases of SQLite.
6326 ** New verbs may be added in future releases of SQLite. Existing verbs
6458 ** <dd>^This is the number of times that SQLite has stepped forward in
6494 ** the pluggable module. The SQLite core has no knowledge of
6527 ** SQLite is used for the page cache.
6530 ** the amount of memory consumed by SQLite, the way in which
6540 ** internal buffer by SQLite within the call to [sqlite3_config]. Hence
6561 ** ^SQLite automatically serializes calls to the xInit method,
6567 ** ^SQLite will never invoke xInit() more than once without an intervening
6571 ** ^SQLite invokes the xCreate() method to construct a new cache instance.
6572 ** SQLite will typically create one cache instance for each open database file,
6578 ** a number less than 250. SQLite will use the
6581 ** on the SQLite version, the target platform, and how SQLite was compiled.
6586 ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will
6594 ** ^(The xCachesize() method may be called at any time by SQLite to set the
6597 ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable
6611 ** a pointer to the szExtra bytes of extra storage that SQLite has requested
6633 ** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1. SQLite
6635 ** failed.)^ In between the to xFetch() calls, SQLite may
6640 ** ^xUnpin() is called by SQLite with a pointer to a currently pinned page
6659 ** When SQLite calls the xTruncate() method, the cache must discard all
6668 ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
6673 ** ^SQLite invokes the xShrink() method when it wants the page cache to
6698 ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is
6725 ** See Also: [Using the SQLite Online Backup API]
6736 ** See Also: [Using the SQLite Online Backup API]
6738 ** ^SQLite holds a write transaction open on the destination database file
6884 ** ^If SQLite is compiled and configured to support threadsafe database
6891 ** sqlite3_backup_finish(). SQLite does not currently check to see
6928 ** [SQLite Shared-Cache Mode] for a description of shared-cache locking.
6929 ** ^This API may be used to register a callback that SQLite will invoke
6934 ** See Also: [Using the SQLite Unlock Notification Feature].
6958 ** a read-lock on the same table, then SQLite arbitrarily selects one of
6981 ** However, the signature of the callback function allows SQLite to pass
7023 ** SQLite checks if there are any currently executing SELECT statements
7049 ** independence" that SQLite uses internally when comparing identifiers.
7061 ** SQL dialect used by SQLite. ^The sqlite3_strglob(P,X) function is case
7100 ** ^The callback is invoked by SQLite after the commit has taken place and
7114 ** SQLite code base to cause the statement that provoked the callback
7117 ** that does not correspond to any valid SQLite error code, the results
7316 ** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite
7320 ** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode
7329 ** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT
7436 void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */