@@ -148,9 +148,9 @@ extern "C" {
148
148
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
149
149
** [sqlite_version()] and [sqlite_source_id()].
150
150
*/
151
- #define SQLITE_VERSION "3.48 .0"
152
- #define SQLITE_VERSION_NUMBER 3048000
153
- #define SQLITE_SOURCE_ID "2025-01-14 11:05:00 d2fe6b05f38d9d7cd78c5d252e99ac59f1aea071d669830c1ffe4e8966e84010 "
151
+ #define SQLITE_VERSION "3.49 .0"
152
+ #define SQLITE_VERSION_NUMBER 3049000
153
+ #define SQLITE_SOURCE_ID "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde "
154
154
155
155
/*
156
156
** CAPI3REF: Run-Time Library Version Numbers
@@ -2213,7 +2213,15 @@ struct sqlite3_mem_methods {
2213
2213
** CAPI3REF: Database Connection Configuration Options
2214
2214
**
2215
2215
** These constants are the available integer configuration options that
2216
- ** can be passed as the second argument to the [sqlite3_db_config()] interface.
2216
+ ** can be passed as the second parameter to the [sqlite3_db_config()] interface.
2217
+ **
2218
+ ** The [sqlite3_db_config()] interface is a var-args functions. It takes a
2219
+ ** variable number of parameters, though always at least two. The number of
2220
+ ** parameters passed into sqlite3_db_config() depends on which of these
2221
+ ** constants is given as the second parameter. This documentation page
2222
+ ** refers to parameters beyond the second as "arguments". Thus, when this
2223
+ ** page says "the N-th argument" it means "the N-th parameter past the
2224
+ ** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
2217
2225
**
2218
2226
** New configuration options may be added in future releases of SQLite.
2219
2227
** Existing configuration options might be discontinued. Applications
@@ -2225,8 +2233,14 @@ struct sqlite3_mem_methods {
2225
2233
** <dl>
2226
2234
** [[SQLITE_DBCONFIG_LOOKASIDE]]
2227
2235
** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
2228
- ** <dd> ^This option takes three additional arguments that determine the
2229
- ** [lookaside memory allocator] configuration for the [database connection].
2236
+ ** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2237
+ ** configuration of the lookaside memory allocator within a database
2238
+ ** connection.
2239
+ ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2240
+ ** in the [DBCONFIG arguments|usual format].
2241
+ ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2242
+ ** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2243
+ ** should have a total of five parameters.
2230
2244
** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2231
2245
** pointer to a memory buffer to use for lookaside memory.
2232
2246
** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
@@ -2249,7 +2263,8 @@ struct sqlite3_mem_methods {
2249
2263
** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
2250
2264
** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
2251
2265
** <dd> ^This option is used to enable or disable the enforcement of
2252
- ** [foreign key constraints]. There should be two additional arguments.
2266
+ ** [foreign key constraints]. This is the same setting that is
2267
+ ** enabled or disabled by the [PRAGMA foreign_keys] statement.
2253
2268
** The first argument is an integer which is 0 to disable FK enforcement,
2254
2269
** positive to enable FK enforcement or negative to leave FK enforcement
2255
2270
** unchanged. The second parameter is a pointer to an integer into which
@@ -2271,13 +2286,13 @@ struct sqlite3_mem_methods {
2271
2286
** <p>Originally this option disabled all triggers. ^(However, since
2272
2287
** SQLite version 3.35.0, TEMP triggers are still allowed even if
2273
2288
** this option is off. So, in other words, this option now only disables
2274
- ** triggers in the main database schema or in the schemas of ATTACH-ed
2289
+ ** triggers in the main database schema or in the schemas of [ ATTACH] -ed
2275
2290
** databases.)^ </dd>
2276
2291
**
2277
2292
** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
2278
2293
** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
2279
2294
** <dd> ^This option is used to enable or disable [CREATE VIEW | views].
2280
- ** There should be two additional arguments.
2295
+ ** There must be two additional arguments.
2281
2296
** The first argument is an integer which is 0 to disable views,
2282
2297
** positive to enable views or negative to leave the setting unchanged.
2283
2298
** The second parameter is a pointer to an integer into which
@@ -2296,7 +2311,7 @@ struct sqlite3_mem_methods {
2296
2311
** <dd> ^This option is used to enable or disable the
2297
2312
** [fts3_tokenizer()] function which is part of the
2298
2313
** [FTS3] full-text search engine extension.
2299
- ** There should be two additional arguments.
2314
+ ** There must be two additional arguments.
2300
2315
** The first argument is an integer which is 0 to disable fts3_tokenizer() or
2301
2316
** positive to enable fts3_tokenizer() or negative to leave the setting
2302
2317
** unchanged.
@@ -2311,7 +2326,7 @@ struct sqlite3_mem_methods {
2311
2326
** interface independently of the [load_extension()] SQL function.
2312
2327
** The [sqlite3_enable_load_extension()] API enables or disables both the
2313
2328
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
2314
- ** There should be two additional arguments.
2329
+ ** There must be two additional arguments.
2315
2330
** When the first argument to this interface is 1, then only the C-API is
2316
2331
** enabled and the SQL function remains disabled. If the first argument to
2317
2332
** this interface is 0, then both the C-API and the SQL function are disabled.
@@ -2325,23 +2340,30 @@ struct sqlite3_mem_methods {
2325
2340
**
2326
2341
** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2327
2342
** <dd> ^This option is used to change the name of the "main" database
2328
- ** schema. ^The sole argument is a pointer to a constant UTF8 string
2329
- ** which will become the new schema name in place of "main". ^SQLite
2330
- ** does not make a copy of the new main schema name string, so the application
2331
- ** must ensure that the argument passed into this DBCONFIG option is unchanged
2332
- ** until after the database connection closes.
2343
+ ** schema. This option does not follow the
2344
+ ** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
2345
+ ** This option takes exactly one additional argument so that the
2346
+ ** [sqlite3_db_config()] call has a total of three parameters. The
2347
+ ** extra argument must be a pointer to a constant UTF8 string which
2348
+ ** will become the new schema name in place of "main". ^SQLite does
2349
+ ** not make a copy of the new main schema name string, so the application
2350
+ ** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
2351
+ ** is unchanged until after the database connection closes.
2333
2352
** </dd>
2334
2353
**
2335
2354
** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
2336
2355
** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
2337
- ** <dd> Usually, when a database in wal mode is closed or detached from a
2338
- ** database handle, SQLite checks if this will mean that there are now no
2339
- ** connections at all to the database. If so, it performs a checkpoint
2340
- ** operation before closing the connection. This option may be used to
2341
- ** override this behavior. The first parameter passed to this operation
2342
- ** is an integer - positive to disable checkpoints-on-close, or zero (the
2343
- ** default) to enable them, and negative to leave the setting unchanged.
2344
- ** The second parameter is a pointer to an integer
2356
+ ** <dd> Usually, when a database in [WAL mode] is closed or detached from a
2357
+ ** database handle, SQLite checks if if there are other connections to the
2358
+ ** same database, and if there are no other database connection (if the
2359
+ ** connection being closed is the last open connection to the database),
2360
+ ** then SQLite performs a [checkpoint] before closing the connection and
2361
+ ** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
2362
+ ** be used to override that behavior. The first argument passed to this
2363
+ ** operation (the third parameter to [sqlite3_db_config()]) is an integer
2364
+ ** which is positive to disable checkpoints-on-close, or zero (the default)
2365
+ ** to enable them, and negative to leave the setting unchanged.
2366
+ ** The second argument (the fourth parameter) is a pointer to an integer
2345
2367
** into which is written 0 or 1 to indicate whether checkpoints-on-close
2346
2368
** have been disabled - 0 if they are not disabled, 1 if they are.
2347
2369
** </dd>
@@ -2502,7 +2524,7 @@ struct sqlite3_mem_methods {
2502
2524
** statistics. For statistics to be collected, the flag must be set on
2503
2525
** the database handle both when the SQL statement is prepared and when it
2504
2526
** is stepped. The flag is set (collection of statistics is enabled)
2505
- ** by default. This option takes two arguments: an integer and a pointer to
2527
+ ** by default. <p> This option takes two arguments: an integer and a pointer to
2506
2528
** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2507
2529
** leave unchanged the statement scanstatus option. If the second argument
2508
2530
** is not NULL, then the value of the statement scanstatus setting after
@@ -2516,7 +2538,7 @@ struct sqlite3_mem_methods {
2516
2538
** in which tables and indexes are scanned so that the scans start at the end
2517
2539
** and work toward the beginning rather than starting at the beginning and
2518
2540
** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the
2519
- ** same as setting [PRAGMA reverse_unordered_selects]. This option takes
2541
+ ** same as setting [PRAGMA reverse_unordered_selects]. <p> This option takes
2520
2542
** two arguments which are an integer and a pointer to an integer. The first
2521
2543
** argument is 1, 0, or -1 to enable, disable, or leave unchanged the
2522
2544
** reverse scan order flag, respectively. If the second argument is not NULL,
@@ -2525,7 +2547,76 @@ struct sqlite3_mem_methods {
2525
2547
** first argument.
2526
2548
** </dd>
2527
2549
**
2550
+ ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]]
2551
+ ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE</dt>
2552
+ ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE option enables or disables
2553
+ ** the ability of the [ATTACH DATABASE] SQL command to create a new database
2554
+ ** file if the database filed named in the ATTACH command does not already
2555
+ ** exist. This ability of ATTACH to create a new database is enabled by
2556
+ ** default. Applications can disable or reenable the ability for ATTACH to
2557
+ ** create new database files using this DBCONFIG option.<p>
2558
+ ** This option takes two arguments which are an integer and a pointer
2559
+ ** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
2560
+ ** leave unchanged the attach-create flag, respectively. If the second
2561
+ ** argument is not NULL, then 0 or 1 is written into the integer that the
2562
+ ** second argument points to depending on if the attach-create flag is set
2563
+ ** after processing the first argument.
2564
+ ** </dd>
2565
+ **
2566
+ ** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
2567
+ ** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
2568
+ ** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
2569
+ ** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
2570
+ ** This capability is enabled by default. Applications can disable or
2571
+ ** reenable this capability using the current DBCONFIG option. If the
2572
+ ** the this capability is disabled, the [ATTACH] command will still work,
2573
+ ** but the database will be opened read-only. If this option is disabled,
2574
+ ** then the ability to create a new database using [ATTACH] is also disabled,
2575
+ ** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
2576
+ ** option.<p>
2577
+ ** This option takes two arguments which are an integer and a pointer
2578
+ ** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
2579
+ ** leave unchanged the ability to ATTACH another database for writing,
2580
+ ** respectively. If the second argument is not NULL, then 0 or 1 is written
2581
+ ** into the integer to which the second argument points, depending on whether
2582
+ ** the ability to ATTACH a read/write database is enabled or disabled
2583
+ ** after processing the first argument.
2584
+ ** </dd>
2585
+ **
2586
+ ** [[SQLITE_DBCONFIG_ENABLE_COMMENTS]]
2587
+ ** <dt>SQLITE_DBCONFIG_ENABLE_COMMENTS</dt>
2588
+ ** <dd>The SQLITE_DBCONFIG_ENABLE_COMMENTS option enables or disables the
2589
+ ** ability to include comments in SQL text. Comments are enabled by default.
2590
+ ** An application can disable or reenable comments in SQL text using this
2591
+ ** DBCONFIG option.<p>
2592
+ ** This option takes two arguments which are an integer and a pointer
2593
+ ** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
2594
+ ** leave unchanged the ability to use comments in SQL text,
2595
+ ** respectively. If the second argument is not NULL, then 0 or 1 is written
2596
+ ** into the integer that the second argument points to depending on if
2597
+ ** comments are allowed in SQL text after processing the first argument.
2598
+ ** </dd>
2599
+ **
2528
2600
** </dl>
2601
+ **
2602
+ ** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
2603
+ **
2604
+ ** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
2605
+ ** overall call to [sqlite3_db_config()] has a total of four parameters.
2606
+ ** The first argument (the third parameter to sqlite3_db_config()) is a integer.
2607
+ ** The second argument is a pointer to an integer. If the first argument is 1,
2608
+ ** then the option becomes enabled. If the first integer argument is 0, then the
2609
+ ** option is disabled. If the first argument is -1, then the option setting
2610
+ ** is unchanged. The second argument, the pointer to an integer, may be NULL.
2611
+ ** If the second argument is not NULL, then a value of 0 or 1 is written into
2612
+ ** the integer to which the second argument points, depending on whether the
2613
+ ** setting is disabled or enabled after applying any changes specified by
2614
+ ** the first argument.
2615
+ **
2616
+ ** <p>While most SQLITE_DBCONFIG options use the argument format
2617
+ ** described in the previous paragraph, the [SQLITE_DBCONFIG_MAINDBNAME]
2618
+ ** and [SQLITE_DBCONFIG_LOOKASIDE] options are different. See the
2619
+ ** documentation of those exceptional options for details.
2529
2620
*/
2530
2621
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
2531
2622
#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
@@ -2547,7 +2638,10 @@ struct sqlite3_mem_methods {
2547
2638
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
2548
2639
#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
2549
2640
#define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
2550
- #define SQLITE_DBCONFIG_MAX 1019 /* Largest DBCONFIG */
2641
+ #define SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE 1020 /* int int* */
2642
+ #define SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE 1021 /* int int* */
2643
+ #define SQLITE_DBCONFIG_ENABLE_COMMENTS 1022 /* int int* */
2644
+ #define SQLITE_DBCONFIG_MAX 1022 /* Largest DBCONFIG */
2551
2645
2552
2646
/*
2553
2647
** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -10750,8 +10844,9 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
10750
10844
/*
10751
10845
** CAPI3REF: Serialize a database
10752
10846
**
10753
- ** The sqlite3_serialize(D,S,P,F) interface returns a pointer to memory
10754
- ** that is a serialization of the S database on [database connection] D.
10847
+ ** The sqlite3_serialize(D,S,P,F) interface returns a pointer to
10848
+ ** memory that is a serialization of the S database on
10849
+ ** [database connection] D. If S is a NULL pointer, the main database is used.
10755
10850
** If P is not a NULL pointer, then the size of the database in bytes
10756
10851
** is written into *P.
10757
10852
**
0 commit comments