1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-21 13:38:01 +03:00
Commit Graph

30855 Commits

Author SHA1 Message Date
stephan
df3fca8da4 Enable the SQLITE_EXPERIMENTAL_PRAGMA_20251114 in the WASM builds for the sake of VFS experimentors. The links in the comments describe what that does.
FossilOrigin-Name: aaa55a3ebf8e725443030be5f31ac7fc0766c1f3c771ce69852f31e7e6f165b9
2025-11-20 12:12:55 +00:00
drh
c23a1b9bea Fix three harmless declaration-after-statement warnings in the new CLI code.
FossilOrigin-Name: b65b29656c835db22557733f4dcfe906bf21a7a3c36266cbbc7e3277f029b901
2025-11-19 19:37:28 +00:00
drh
f1928b3e54 Do not attempt to make the generated file "shell.c" read-only. This turns
out to be annoying in general, and especially annoying on macs.

FossilOrigin-Name: 6ab18d036a3e412ee01806a40f69aca2b77283bd5336df27597cc19d32e6e6f2
2025-11-18 19:11:21 +00:00
drh
f639befec8 New subcomponent, the Query Result Formatter (QRF), that formats query
results for display to humans on a fixed-width font terminal.  Rework the
CLI to make use of the QRF.  Renovate the .mode command of the CLI.  Also
incorporate the QRF into the TCL interface as the "format" method.

FossilOrigin-Name: 7e460ffa5aae884807db9e7c8214d6d822d5d38ea406fe3b3eac04ac16f158fa
2025-11-18 17:49:48 +00:00
drh
4b43acc718 Add support for SQLITE_LIMIT_PARSER_DEPTH to limit the size of the stack
used by the parser.  This can help prevent deeply nested parse trees that
then cause problems on machines with smaller CPU stacks.  Modify the
%realloc and %free directives of Lemon and add the new %stack_size_limit
directive in support of this capability.

FossilOrigin-Name: 52ba0c731d004409353a55ce8ca5a514ce486a077a2be82db5b8fea7619848d5
2025-11-18 17:27:46 +00:00
drh
9e91a1fe89 Modify the "%realloc" and "%free" commands in Lemon so that the functions
they specify take an extra parameter at the end, the %extra_context pointer.
This allows the implementation to distinguish between OOM errors and
failures to increase the stack size because of the stack size limit.

FossilOrigin-Name: 9862c945d9a8531f9bef123aee9ed1fd3f64542250a57beb3a150227bc3c1a12
2025-11-18 15:40:02 +00:00
drh
9432655038 Lower the default stack size for the parse to 50.
FossilOrigin-Name: 41fe19ab054acda912bc32dd6f9c6412416ab1af6cf55515e96c89fb55b46424
2025-11-18 15:20:22 +00:00
drh
fef2233090 Add the SQLITE_LIMIT_PARSER_DEPTH value for sqlite3_limit(). This isn't
something that many applications will need, but it is useful for testing.

FossilOrigin-Name: 8f0b07f36159225c476f756f8f9b35c75783bc8bed43b578f4d1055fa800ecc9
2025-11-18 14:48:33 +00:00
drh
d26ac414c8 Yet another attempt at controlling the parser stack size.
FossilOrigin-Name: cb19986dc6bc483df21e082e54a14cb6d7540b1734259e6d326d676908ac0172
2025-11-18 13:03:08 +00:00
drh
ef4abc0a63 Fix incorrect "#line" generation in Lemon.
FossilOrigin-Name: 5c0214df2c0a7470ac2edca0c483a3edd3c39ef0739688ab9a06e23882200360
2025-11-18 10:38:41 +00:00
stephan
847d2ed685 Add api.oo1=0 flag to ext/wasm/GNUmakefile to strip out the sqlite3.oo1 pieces from the build. Part of the ongoing response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0].
FossilOrigin-Name: ea48567ac54e4949a8b68977a58a5de7946e074ae8737133071d02f40ac97f34
2025-11-17 23:55:41 +00:00
drh
07e071e500 If SQL is entered as additional command-line arguments to CLI, that counts
the same as getting input from a pipe or file for the purpose of determining
the default format mode.

FossilOrigin-Name: 3d55ec15a9e4dc8af4bf1e2884eaa2c809995fb1529633f73287dc7a54153629
2025-11-17 19:46:04 +00:00
drh
18a9bdd90a Fix a harmless compiler warning.
FossilOrigin-Name: 6621737cc05cbf8ff5f576775a8a3c64f666b56d42939968ebb55d72a835646b
2025-11-17 19:19:58 +00:00
drh
53794ab541 The -textjsonb option is on by default in the standard non-batch mode of
the CLI.  New fast screening test for JSONB.

FossilOrigin-Name: fd09f934d64ec07fd56f1b80ab05dafb28b605d5802ff5758eea17d8ad24e3cc
2025-11-17 18:51:55 +00:00
drh
234d2e51ac CLI comes up in legacy "list" mode if neither stdin or stdout are a tty, or
if "--compat 20251114" or earlier is specified, or if "--batch" is used.
New modes "batch" and "tty" select either legacy "list" mode or the newer
"qbox" mode with limits.
Make CVS output compatible with legacy.  Break out ".import" into a separate
subroutine in anticipation of forthcoming improvements.  General code
cleanup.

FossilOrigin-Name: f6bfcea9a01493af182e9aa0d35df6f81bf9e36220df79139afa287fa43d9aa3
2025-11-17 16:44:13 +00:00
drh
02268693c3 Fix test cases impacted by the use of ~/.sqliterc
FossilOrigin-Name: 8fc05faef91186429c6c710991fd736b1df9a9af946c29d207db2518d6436b38
2025-11-17 00:15:14 +00:00
drh
4d91527aa5 Fix a bug in ".show". Adjust test cases for the new default mode.
FossilOrigin-Name: 2aebd7bfecaaf1f75b52b05a0d3009fc0dc61289ae666d24cb4e3ddfaf251645
2025-11-16 23:06:45 +00:00
drh
1db7790ecb Default .mode is now qbox with limits. New --compat YYYYMMDD command-line
option, and new -DCOMPATIBILITY_DATE=YYYYMMDD compile-time options can
override.  Command ".mode YYYYMMDD" sets the mode to the default for the
date given.

FossilOrigin-Name: 52e022375961ad9460412e40e100219ee59055eb0ab309cbfc2ab19f61929a45
2025-11-16 17:27:21 +00:00
drh
e20406040a Fix a long-standing bug in .schema when the argument contains a ".".
FossilOrigin-Name: 404576214fc20161cdcb031d57696d6068506309c8faecd3e4424e5ced28046b
2025-11-16 10:49:51 +00:00
drh
4dc404cef4 Fix a problem with the new command-line parsing in the CLI.
FossilOrigin-Name: 3e02804c387c89afde59eef8e464c6011e083e158873e4f8ab1f17bcc12b7c28
2025-11-16 02:32:06 +00:00
drh
f4870a2b51 Improved --safe mode defenses. Fix a test case error.
FossilOrigin-Name: eacc9db80de8baa878ebdc3a054538c8998db9a2e46720c0d8b109d62a0cac29
2025-11-16 01:34:01 +00:00
drh
36a54c001e Improved error detection in the argument to .mode --widths.
FossilOrigin-Name: 4d774ee495e38282b8701988fe514344ee0e81285692c8d1adc1ee7e22960ad9
2025-11-16 01:03:53 +00:00
drh
4e12c0b0e9 Fix formatting problem in .schema and .fullschema
FossilOrigin-Name: 4035fb15ff36d139ed4c839fdebb0278e6cf9a2f00298e1a548a8f8317ba14b2
2025-11-16 00:56:24 +00:00
drh
1d06c9f700 Help text improvements in the CLI.
FossilOrigin-Name: dcaabd97d5064dd70fb386a2eef55f4301bba4b54915ed6a91d736abe7a04ae8
2025-11-15 20:10:32 +00:00
stephan
3e2ecc390b Remove an unused struct.
FossilOrigin-Name: 93dd0e62b74a0d99803f680f23953e9fa2429074505ba402ca5ed4610ddef8fb
2025-11-15 16:06:03 +00:00
drh
3b2754446a Bug fix to the --lineline option in the CLI. Other minor CLI tweaks.
FossilOrigin-Name: 40f81a9f9f6ea29144174fbd487f83d150a1be8f35e7496bfc1cfc6a556b6312
2025-11-15 15:30:55 +00:00
stephan
a1dede1e58 JNI: when validing the eTextRep argument in sqlite3_create_function(), only validate the lower four bits (the high bits are for other flags). Add flags to test functions to ensure this case is triggered.
FossilOrigin-Name: aab640be7bc5829fe16d2582b13f942b7debb271c150ca2471561de6b2d70dc7
2025-11-15 15:30:45 +00:00
drh
dd3b30ec85 Columnar modes respond to nScreenWidth.
FossilOrigin-Name: 60d26ebb4d91cc885b6b938ef2fc2864ebbf5a18d2e456521ee2f4aa3b22eddf
2025-11-15 15:18:41 +00:00
stephan
982274b8e9 Replace the JNI binding's internal use of sqlite3ErrorWithMsg() with sqlite3_set_errmsg() and have it handle OOM in a way consistent with the rest of the JNI bindings.
FossilOrigin-Name: 0899a9eb3af727f310372f3441573ab506ffec31dca4774e850b2b59a4001ee0
2025-11-15 15:09:04 +00:00
stephan
e83ffd5c87 Random JS build cleanups and parallel build mkdir race fixes. Reinstate the recently-removed [a65bd978cbc646ec] after finding a reformulation which works on Emscripten 4.0.19 (and saves about 85kb on the JS deliverables).
FossilOrigin-Name: acb1525a49463de67716638626406ccde9a282907d0de218ab88bf474ba830ee
2025-11-15 13:30:13 +00:00
drh
18c7b4d651 Columnar formats respond to --screenwidth restrictions by removing
cell padding.

FossilOrigin-Name: cbe233ca131118692fd4a84d8fcf0dfca926fa935f66cfb718c235d54084de3d
2025-11-15 12:09:13 +00:00
stephan
393a4d8ac5 Reorder initialization of sqlite3ApiBootstrap()'s bownstrapped config object so that it's possible to inject the wasm memory and exports via that, to simplify plugging-in of sqlite3-api.js in other builds. Previously the build-provided wasm exports/memory overrode any which a client might want to use.
FossilOrigin-Name: 2bd0addb6068cd2b34f6151a824c578e2253f541a8c55b578219b09c42afd82b
2025-11-15 11:53:30 +00:00
stephan
987870a6a0 Generic internal JS cleanups towards improving portability of sqlite3-api.js to other build systems.
FossilOrigin-Name: 5bc37e5c2fcd83fd0bc40234144072363f1cbf7d811a15b74a0991e397a35eb8
2025-11-15 11:30:45 +00:00
drh
3338ca5f56 Data structure improvements on columnar layout. Prep work for getting
columnar layouts to respond to nScreenWidth.

FossilOrigin-Name: 777eeb2ed2708faf42559387bd582b9345a794798a0327e4fcd75e37948eac60
2025-11-15 11:28:23 +00:00
stephan
a804a65617 Move sqlite3-api-cleanup.js into post-js-footer.js to remove the final direct Emscripten dependency from the intermediary build product sqlite3-api.js (the whole library, waiting to be bootstrapped). This is partly in response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0], which demonstrates a potential use case for a standalone sqlite3-api.js. This is a build/doc change, not a functional one.
FossilOrigin-Name: 2fcbd8e17d8f1dd7e9d45168805dba718777e46803d9375a4212296d3d0cd89c
2025-11-15 09:19:03 +00:00
stephan
5279cbd353 API doc typo fix.
FossilOrigin-Name: c1e9791fbf9e4c2ca6f9f031ea2c26d8b4bfb4d54850a53853f2b2d9620792ef
2025-11-15 08:05:12 +00:00
drh
7a0d5bdd29 Improve columnar layout in QRF so that it correctly deals with control
characters, and especially tabs.

FossilOrigin-Name: 0650e2b83170b44c1ba944259a96d41e1a14a57004d4f1f80dc5640ae837a81e
2025-11-15 00:23:09 +00:00
drh
850da77de1 Make use of the new sqlite3_str_free() interface in the CLI.
FossilOrigin-Name: 2e07bc29ab1ca66049337f2cfbefcd57bdcd691a381b309fb8a5db6e72e56d03
2025-11-14 21:49:27 +00:00
drh
c2b9896e50 Enforce the --charlimit constraint in QRF.
FossilOrigin-Name: c25f8fdedd8d68e3551a445e24e1c60e105e18f9cf8f1badcbb77a58974f3381
2025-11-14 21:40:20 +00:00
drh
9a3561e2d9 Merge the latest trunk enhancements into the qrf branch.
FossilOrigin-Name: 9ee892b4f97c91208a658f09add00a567406e913edb022a2fd53333ea01c2b26
2025-11-14 20:11:15 +00:00
drh
c14ae9cd3b New interfaces sqlite3_str_truncate() and sqlite3_str_free(). Version number
increases to 3.52.0.

FossilOrigin-Name: fa85534ed927851dc37a4943e83259bff4509f141449226ffb506f9acc7b2cc5
2025-11-14 20:09:01 +00:00
drh
c5d6fbdeea Fix harmless display bug in previous check-in. Add the -noinit command-line
option to bypass reading the ~/.sqliterc file.

FossilOrigin-Name: 229650a01dcd9cc4b39526d661106e9c3eb2f90ca7fbed8adc6e6fe85ef3fdaa
2025-11-14 19:04:23 +00:00
drh
8254c1a4fa Add the --tag and --list options to the ".mode" command.
FossilOrigin-Name: 9daf98c2f449688b7463b71dfa926cb4ae96d8c7ee34946df2172bb37f7c5616
2025-11-14 18:41:21 +00:00
dan
ed7981ea3e If SQLITE_EXPERIMENTAL_PRAGMA_20251114 is defined at build-time, send an experimental pragma file-control to the VFS if a call to take a SHARED lock is to be immediately followed by one to take a RESERVED.
FossilOrigin-Name: e2b3f1a9480a9be3e06c2d79abcf39f399b5adf2ca882841b3b3fa199c239dd8
2025-11-14 17:27:20 +00:00
stephan
e1f7ec65fd Slight restructure of the previous checkin.
FossilOrigin-Name: 8ff98747c072c8c333b1b37cf4ec9344e84f081bd4e6d3b5e75f37b1e1ce9e84
2025-11-14 17:23:24 +00:00
drh
02751a7162 Add the --once option to the .mode command. Improvements to help text.
FossilOrigin-Name: 253980122a35f787423aaeedbec12ec94b31768f245fe1c1fcc7e08911855c60
2025-11-14 17:11:06 +00:00
stephan
505d8a43db In sqlite3-api-cleanup.js, if no Emscripten module is detected then simply return, rather than throw. This should enable the generated sqliet3-api.js (normally an intermediary file) to be used as-is, with the caveat that the caller has to bootstrap the library themselves.
FossilOrigin-Name: d64c9cd4c7a1ffe04de6c75126563d7bbb24266e13d41406f6d55720b8199037
2025-11-14 16:56:51 +00:00
stephan
408c991017 Remove a harmless duplicated makefile var assignment from mkwasmbuilds.c.
FossilOrigin-Name: 4b4a6fbe20d51689e0abc65beed078bbb9418383e69eb8ec13f0657e2cf13bfd
2025-11-14 15:03:55 +00:00
drh
a7b9a10707 Fix harmless compiler warnings. Incorporate "USAGE:" comments on dot-command
implementations into the CLI ".help" command output.

FossilOrigin-Name: 046bfab4a01e8a7cc58d1bdf0756c90ba354562d79e5453c08202daf648e76a6
2025-11-14 14:59:43 +00:00
stephan
09cc9b5184 Fix a makefile ordering bug which caused certain builds to fail unless others had already been built. Remove the superfluous sqlite3-node.wasm from the final deliverables dir (sqlite3-node.mjs uses sqlite3.wasm instead).
FossilOrigin-Name: fd70088284946b9d4315781b3f68133cc0abd4244247f2fce04044feab8a97c0
2025-11-14 14:42:00 +00:00