3131
3232#define SQLITE3MC_VERSION_MAJOR 1
3333#define SQLITE3MC_VERSION_MINOR 5
34- #define SQLITE3MC_VERSION_RELEASE 2
34+ #define SQLITE3MC_VERSION_RELEASE 4
3535#define SQLITE3MC_VERSION_SUBRELEASE 0
36- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.5.2 "
36+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.5.4 "
3737
3838#endif /* SQLITE3MC_VERSION_H_ */
3939/*** End of #include "sqlite3mc_version.h" ***/
@@ -192,9 +192,9 @@ extern "C" {
192192** [sqlite3_libversion_number()], [sqlite3_sourceid()],
193193** [sqlite_version()] and [sqlite_source_id()].
194194*/
195- #define SQLITE_VERSION "3.39.3 "
196- #define SQLITE_VERSION_NUMBER 3039003
197- #define SQLITE_SOURCE_ID "2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8 "
195+ #define SQLITE_VERSION "3.40.0 "
196+ #define SQLITE_VERSION_NUMBER 3040000
197+ #define SQLITE_SOURCE_ID "2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318 "
198198
199199/*
200200** CAPI3REF: Run-Time Library Version Numbers
@@ -716,13 +716,17 @@ SQLITE_API int sqlite3_exec(
716716**
717717** SQLite uses one of these integer values as the second
718718** argument to calls it makes to the xLock() and xUnlock() methods
719- ** of an [sqlite3_io_methods] object.
719+ ** of an [sqlite3_io_methods] object. These values are ordered from
720+ ** lest restrictive to most restrictive.
721+ **
722+ ** The argument to xLock() is always SHARED or higher. The argument to
723+ ** xUnlock is either SHARED or NONE.
720724*/
721- #define SQLITE_LOCK_NONE 0
722- #define SQLITE_LOCK_SHARED 1
723- #define SQLITE_LOCK_RESERVED 2
724- #define SQLITE_LOCK_PENDING 3
725- #define SQLITE_LOCK_EXCLUSIVE 4
725+ #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
726+ #define SQLITE_LOCK_SHARED 1 /* xLock() or xUnlock() */
727+ #define SQLITE_LOCK_RESERVED 2 /* xLock() only */
728+ #define SQLITE_LOCK_PENDING 3 /* xLock() only */
729+ #define SQLITE_LOCK_EXCLUSIVE 4 /* xLock() only */
726730
727731/*
728732** CAPI3REF: Synchronization Type Flags
@@ -800,7 +804,14 @@ struct sqlite3_file {
800804** <li> [SQLITE_LOCK_PENDING], or
801805** <li> [SQLITE_LOCK_EXCLUSIVE].
802806** </ul>
803- ** xLock() increases the lock. xUnlock() decreases the lock.
807+ ** xLock() upgrades the database file lock. In other words, xLock() moves the
808+ ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
809+ ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
810+ ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
811+ ** requested lock, then the call to xLock() is a no-op.
812+ ** xUnlock() downgrades the database file lock to either SHARED or NONE.
813+ * If the lock is already at or below the requested lock state, then the call
814+ ** to xUnlock() is a no-op.
804815** The xCheckReservedLock() method checks whether any database connection,
805816** either in this process or in some other process, is holding a RESERVED,
806817** PENDING, or EXCLUSIVE lock on the file. It returns true
@@ -905,9 +916,8 @@ struct sqlite3_io_methods {
905916** opcode causes the xFileControl method to write the current state of
906917** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
907918** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
908- ** into an integer that the pArg argument points to. This capability
909- ** is used during testing and is only available when the SQLITE_TEST
910- ** compile-time option is used.
919+ ** into an integer that the pArg argument points to.
920+ ** This capability is only available if SQLite is compiled with [SQLITE_DEBUG].
911921**
912922** <li>[[SQLITE_FCNTL_SIZE_HINT]]
913923** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
@@ -1299,6 +1309,26 @@ typedef struct sqlite3_mutex sqlite3_mutex;
12991309*/
13001310typedef struct sqlite3_api_routines sqlite3_api_routines;
13011311
1312+ /*
1313+ ** CAPI3REF: File Name
1314+ **
1315+ ** Type [sqlite3_filename] is used by SQLite to pass filenames to the
1316+ ** xOpen method of a [VFS]. It may be cast to (const char*) and treated
1317+ ** as a normal, nul-terminated, UTF-8 buffer containing the filename, but
1318+ ** may also be passed to special APIs such as:
1319+ **
1320+ ** <ul>
1321+ ** <li> sqlite3_filename_database()
1322+ ** <li> sqlite3_filename_journal()
1323+ ** <li> sqlite3_filename_wal()
1324+ ** <li> sqlite3_uri_parameter()
1325+ ** <li> sqlite3_uri_boolean()
1326+ ** <li> sqlite3_uri_int64()
1327+ ** <li> sqlite3_uri_key()
1328+ ** </ul>
1329+ */
1330+ typedef const char *sqlite3_filename;
1331+
13021332/*
13031333** CAPI3REF: OS Interface Object
13041334**
@@ -1477,7 +1507,7 @@ struct sqlite3_vfs {
14771507 sqlite3_vfs *pNext; /* Next registered VFS */
14781508 const char *zName; /* Name of this virtual file system */
14791509 void *pAppData; /* Pointer to application-specific data */
1480- int (*xOpen)(sqlite3_vfs*, const char * zName, sqlite3_file*,
1510+ int (*xOpen)(sqlite3_vfs*, sqlite3_filename zName, sqlite3_file*,
14811511 int flags, int *pOutFlags);
14821512 int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
14831513 int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
@@ -2355,6 +2385,7 @@ struct sqlite3_mem_methods {
23552385** <ul>
23562386** <li> The [PRAGMA writable_schema=ON] statement.
23572387** <li> The [PRAGMA journal_mode=OFF] statement.
2388+ ** <li> The [PRAGMA schema_version=N] statement.
23582389** <li> Writes to the [sqlite_dbpage] virtual table.
23592390** <li> Direct writes to [shadow tables].
23602391** </ul>
@@ -3470,6 +3501,9 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
34703501** <dd>The database is opened [shared cache] enabled, overriding
34713502** the default shared cache setting provided by
34723503** [sqlite3_enable_shared_cache()].)^
3504+ ** The [use of shared cache mode is discouraged] and hence shared cache
3505+ ** capabilities may be omitted from many builds of SQLite. In such cases,
3506+ ** this option is a no-op.
34733507**
34743508** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
34753509** <dd>The database is opened [shared cache] disabled, overriding
@@ -3485,7 +3519,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
34853519** to return an extended result code.</dd>
34863520**
34873521** [[OPEN_NOFOLLOW]] ^(<dt>[SQLITE_OPEN_NOFOLLOW]</dt>
3488- ** <dd>The database filename is not allowed to be a symbolic link</dd>
3522+ ** <dd>The database filename is not allowed to contain a symbolic link</dd>
34893523** </dl>)^
34903524**
34913525** If the 3rd parameter to sqlite3_open_v2() is not one of the
@@ -3744,10 +3778,10 @@ SQLITE_API int sqlite3_open_v2(
37443778**
37453779** See the [URI filename] documentation for additional information.
37463780*/
3747- SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename , const char *zParam);
3748- SQLITE_API int sqlite3_uri_boolean(const char *zFile , const char *zParam, int bDefault);
3749- SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char* , const char*, sqlite3_int64);
3750- SQLITE_API const char *sqlite3_uri_key(const char *zFilename , int N);
3781+ SQLITE_API const char *sqlite3_uri_parameter(sqlite3_filename z , const char *zParam);
3782+ SQLITE_API int sqlite3_uri_boolean(sqlite3_filename z , const char *zParam, int bDefault);
3783+ SQLITE_API sqlite3_int64 sqlite3_uri_int64(sqlite3_filename , const char*, sqlite3_int64);
3784+ SQLITE_API const char *sqlite3_uri_key(sqlite3_filename z , int N);
37513785
37523786/*
37533787** CAPI3REF: Translate filenames
@@ -3776,9 +3810,9 @@ SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N);
37763810** return value from [sqlite3_db_filename()], then the result is
37773811** undefined and is likely a memory access violation.
37783812*/
3779- SQLITE_API const char *sqlite3_filename_database(const char* );
3780- SQLITE_API const char *sqlite3_filename_journal(const char* );
3781- SQLITE_API const char *sqlite3_filename_wal(const char* );
3813+ SQLITE_API const char *sqlite3_filename_database(sqlite3_filename );
3814+ SQLITE_API const char *sqlite3_filename_journal(sqlite3_filename );
3815+ SQLITE_API const char *sqlite3_filename_wal(sqlite3_filename );
37823816
37833817/*
37843818** CAPI3REF: Database File Corresponding To A Journal
@@ -3844,14 +3878,14 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
38443878** then the corresponding [sqlite3_module.xClose() method should also be
38453879** invoked prior to calling sqlite3_free_filename(Y).
38463880*/
3847- SQLITE_API char * sqlite3_create_filename(
3881+ SQLITE_API sqlite3_filename sqlite3_create_filename(
38483882 const char *zDatabase,
38493883 const char *zJournal,
38503884 const char *zWal,
38513885 int nParam,
38523886 const char **azParam
38533887);
3854- SQLITE_API void sqlite3_free_filename(char* );
3888+ SQLITE_API void sqlite3_free_filename(sqlite3_filename );
38553889
38563890/*
38573891** CAPI3REF: Error Codes And Messages
@@ -5554,6 +5588,16 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
55545588** then the conversion is performed. Otherwise no conversion occurs.
55555589** The [SQLITE_INTEGER | datatype] after conversion is returned.)^
55565590**
5591+ ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5592+ ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current encoding
5593+ ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5594+ ** returns something other than SQLITE_TEXT, then the return value from
5595+ ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5596+ ** sqlite3_value_text(X), sqlite3_value_text16(X), sqlite3_value_text16be(X),
5597+ ** sqlite3_value_text16le(X), sqlite3_value_bytes(X), or
5598+ ** sqlite3_value_bytes16(X) might change the encoding of the value X and
5599+ ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5600+ **
55575601** ^Within the [xUpdate] method of a [virtual table], the
55585602** sqlite3_value_nochange(X) interface returns true if and only if
55595603** the column corresponding to X is unchanged by the UPDATE operation
@@ -5618,6 +5662,7 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*);
56185662SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
56195663SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
56205664SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
5665+ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
56215666
56225667/*
56235668** CAPI3REF: Finding The Subtype Of SQL Values
@@ -5671,7 +5716,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*);
56715716**
56725717** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer
56735718** when first called if N is less than or equal to zero or if a memory
5674- ** allocate error occurs.
5719+ ** allocation error occurs.
56755720**
56765721** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
56775722** determined by the N parameter on first successful call. Changing the
@@ -5876,9 +5921,10 @@ typedef void (*sqlite3_destructor_type)(void*);
58765921** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE].
58775922** ^SQLite takes the text result from the application from
58785923** the 2nd parameter of the sqlite3_result_text* interfaces.
5879- ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
5880- ** is negative, then SQLite takes result text from the 2nd parameter
5881- ** through the first zero character.
5924+ ** ^If the 3rd parameter to any of the sqlite3_result_text* interfaces
5925+ ** other than sqlite3_result_text64() is negative, then SQLite computes
5926+ ** the string length itself by searching the 2nd parameter for the first
5927+ ** zero character.
58825928** ^If the 3rd parameter to the sqlite3_result_text* interfaces
58835929** is non-negative, then as many bytes (not characters) of the text
58845930** pointed to by the 2nd parameter are taken as the application-defined
@@ -6374,7 +6420,7 @@ SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);
63746420** <li> [sqlite3_filename_wal()]
63756421** </ul>
63766422*/
6377- SQLITE_API const char * sqlite3_db_filename(sqlite3 *db, const char *zDbName);
6423+ SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName);
63786424
63796425/*
63806426** CAPI3REF: Determine if a database is read-only
@@ -6511,7 +6557,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
65116557** function C that is invoked prior to each autovacuum of the database
65126558** file. ^The callback is passed a copy of the generic data pointer (P),
65136559** the schema-name of the attached database that is being autovacuumed,
6514- ** the the size of the database file in pages, the number of free pages,
6560+ ** the size of the database file in pages, the number of free pages,
65156561** and the number of bytes per page, respectively. The callback should
65166562** return the number of free pages that should be removed by the
65176563** autovacuum. ^If the callback returns zero, then no autovacuum happens.
@@ -6632,6 +6678,11 @@ SQLITE_API void *sqlite3_update_hook(
66326678** to the same database. Sharing is enabled if the argument is true
66336679** and disabled if the argument is false.)^
66346680**
6681+ ** This interface is omitted if SQLite is compiled with
6682+ ** [-DSQLITE_OMIT_SHARED_CACHE]. The [-DSQLITE_OMIT_SHARED_CACHE]
6683+ ** compile-time option is recommended because the
6684+ ** [use of shared cache mode is discouraged].
6685+ **
66356686** ^Cache sharing is enabled and disabled for an entire process.
66366687** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]).
66376688** In prior versions of SQLite,
@@ -6730,7 +6781,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*);
67306781** ^The soft heap limit may not be greater than the hard heap limit.
67316782** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N)
67326783** is invoked with a value of N that is greater than the hard heap limit,
6733- ** the the soft heap limit is set to the value of the hard heap limit.
6784+ ** the soft heap limit is set to the value of the hard heap limit.
67346785** ^The soft heap limit is automatically enabled whenever the hard heap
67356786** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and
67366787** the soft heap limit is outside the range of 1..N, then the soft heap
@@ -9025,7 +9076,7 @@ typedef struct sqlite3_backup sqlite3_backup;
90259076** if the application incorrectly accesses the destination [database connection]
90269077** and so no error code is reported, but the operations may malfunction
90279078** nevertheless. Use of the destination database connection while a
9028- ** backup is in progress might also also cause a mutex deadlock.
9079+ ** backup is in progress might also cause a mutex deadlock.
90299080**
90309081** If running in [shared cache mode], the application must
90319082** guarantee that the shared cache used by the destination database
@@ -9453,7 +9504,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2(
94539504*/
94549505#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */
94559506#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */
9456- #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */
9507+ #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for readers */
94579508#define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */
94589509
94599510/*
0 commit comments