Commit Graph

30902 Commits

Author SHA1 Message Date
drh
843418ae70 In the CLI on the ".mode" command, replace the recently added --no-limits option with
"--limits L,C".  And add --sw as an alias for --screenwidth.

FossilOrigin-Name: caefe4c746599b22aec446f3aeb296e53edaf8c54f8ae803381e8c21d5e29ab4
2025-11-24 12:27:18 +00:00
dan
0ec8c56567 Remove the the SQLITE_SYNC_DATAONLY flag from the core on the grounds that it is not currently used by either built-in VFS and is therefore untested.
FossilOrigin-Name: ff2065b533769cbf5278d13d09ffa93a7a0f841b1b59b6be0e5f27e3d1c341d0
2025-11-24 11:22:56 +00:00
stephan
9101b90159 Add the long-missing sqlite3_next_stmt() binding to JS/WASM.
FossilOrigin-Name: de27d2d3f2353309227b4d5f77eff76c108c094b61ac59f5a769229a084f2567
2025-11-23 22:18:26 +00:00
drh
f63bc3a922 New test case for bSplitColumn in QRF.
FossilOrigin-Name: 6d01f9f49eef5f7d4bddadc458691b6ca36e277bae1d4b43b60a128a44e3faca
2025-11-23 10:55:38 +00:00
drh
58a4e08e3d In QRF in bSplitColumn mode, increase the spacing between columns to be as
wide as five, for improved legibility, if screen width allows.

FossilOrigin-Name: 673648cc812e1549c2b3e7749306e7395d0b7e396a7d5ac432948eb3a6c3713f
2025-11-23 00:45:47 +00:00
drh
d0056d4234 Use the new "split" mode to simplify and improve the implementation of
the ".tables" and ".indexes" commands in the CLI.  Fix a bug in QRF
that this new implementation found.

FossilOrigin-Name: b73df612b621699cd58de6ef327fefdeb8f52eb620f0d2df00d38ff6608a8dd5
2025-11-23 00:10:06 +00:00
drh
c4190338c5 Add "split" mode in the CLI. Fix CLI commands given on the command line
so that they honor --once in prior commands.

FossilOrigin-Name: 2530f04d1bb02b800fda83544f5b5dcd42f52b3e56ad625cd03b40e42f24ac6b
2025-11-22 23:34:53 +00:00
drh
eeb38d3665 Add the --no-limits option to the .mode command in the CLI.
FossilOrigin-Name: 3cee168e8801481f6d909fb5d20a773b9c6ca0b8daedfc301c9d762a17f9d839
2025-11-22 21:47:48 +00:00
drh
946857cfee In QRF, change the name of the bWrapSnglCol flag to bSplitColumn.
Similar changes to the TCL interface.

FossilOrigin-Name: 76512b3b80fdcaae22340cde0b69857e2a4d7e86a63c6759465bd8a0bcbf82bc
2025-11-22 21:34:33 +00:00
stephan
2fcc13f8c9 Cherrypick [0b53be562f1e] into trunk.
FossilOrigin-Name: e86e5723d778721b10c1c908545c56233d4d5549a7ca3b7cf8ca649c70450add
2025-11-22 19:29:23 +00:00
drh
494811810c Ignore semicolons at the end of dot-commands, if the compatibility date is
20251115 or later.
[forum:/forumpost/72d084ed552|Forum thread 2025-10-09T21:12:32z]

FossilOrigin-Name: 7a9e753e977ff61ceee50c4e0e5f9b1fc179e91acd9ac88378c888b3e45ebe3a
2025-11-22 16:43:52 +00:00
stephan
c7d155aa5d Cherrypick [e0b33b51229a] for the latest wasmutil/jaccwabyt - all tests are happy. Fix a make deps bug which can break parallel builds involving fiddle.
FossilOrigin-Name: 0be777bd6cc6c6b4f52d948cdba7e9c30ad062a35c659512b3f3f89f53aaba25
2025-11-22 15:49:45 +00:00
drh
f4197be567 Implementation of bWrapSnglCol in QRF.
FossilOrigin-Name: 4bbd3f7ead50c0babd7843f58972e2e1762a84866cc4ed88a2a74375b13da11c
2025-11-22 00:38:17 +00:00
drh
081a877211 Add the bWrapSnglCol flag to the QRF spec, though it is not yet documented
and does not yet work.  Fix column output so that it omits trailing space.

FossilOrigin-Name: a858027fc92727c680b7e984303df7f9e0a2d90c860c547176f290b113a69390
2025-11-21 20:10:12 +00:00
drh
a5e454d11c Need a double-underscore prefix on the cplusplus macro
FossilOrigin-Name: 04394387e626cd99ff98df978c4b7f2d32f65760e0c26e53f1ef4f59e4e91a4f
2025-11-21 19:47:13 +00:00
drh
725e6836d0 Fix the qrf.h header so that it is usable from C++
FossilOrigin-Name: 1105b710934cf4a243c64d37dd147bc9378c0f7aa55a99891b7ac6e8f8f17f88
2025-11-21 19:01:26 +00:00
drh
5b19de37b6 Fix typo in the implementation of the ".schema" command of the CLI for the
case when there are ATTACH-ed databases.

FossilOrigin-Name: 8a230e4da230a7b103749b069a99a58e4c220873c2f9576abdc928c3538d70b3
2025-11-21 17:30:44 +00:00
stephan
794a9b48ac Add new file missing from [3c4061428544].
FossilOrigin-Name: 41f94eca01d8317364aa60ddd8e5fe3cd21a215040ef271a157d450a914139d0
2025-11-21 15:03:38 +00:00
drh
873cd21ec3 Enhance ALTER TABLE to support adding and removing NOT NULL and CHECK
constraints.

FossilOrigin-Name: 895498e4431e02cff65a5d96db22f0b0cb9c96aedf1e3cdcdeb3c34c6fec432b
2025-11-21 14:15:56 +00:00
drh
ac16642cc4 Fix the QRF so that it omits the closing text from styles "json" and "jobject"
when the result set it empty.

FossilOrigin-Name: e1ba175124be83da4db6d5d4e583b9b3b7dcb82e983c6f185d590469dcdc3139
2025-11-21 11:00:29 +00:00
stephan
40ce52a4e5 Move the JS pieces of kvvfs into their own file to facilitate pending feature experimentation.
FossilOrigin-Name: 3c40614285449df259a3444e36f888cfb5e782ea58287914f97f496ea61e9e9f
2025-11-21 10:49:32 +00:00
drh
1073985be7 Test cases for the fix in the prior check-in.
FossilOrigin-Name: 4d41bee75eda51251121c8e3903f47941116e5182238a03f41a593c47efb6fcf
2025-11-20 22:46:27 +00:00
drh
980580efec Preserve auto-explain mode across mode changes, as has always been the
case before.

FossilOrigin-Name: 8896185ae0b0af8918aa8ce449f18759e6ae60358afbac1019397bae307b15d5
2025-11-20 21:08:46 +00:00
drh
a68046e79d Fix hwtime.h (broken by [305bb022368bac9f]) so that unamalgamated windows
builds work again.

FossilOrigin-Name: 1245319257d03a00eddbc8ff4b43b5813f8a567a12a9957f923bef58c85c0c20
2025-11-20 12:41:26 +00:00
stephan
6d62ed4f87 Remove an extraneous loop level from the JS bootstrapping bits.
FossilOrigin-Name: 86817b4e9f011d296fb420be95269fecb54fb48a220bce84020e3af2d2c164a4
2025-11-20 12:14:03 +00:00
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
3df99c4861 Use sqlite3MPrintf() instead of sqlite3_mprintf() internally in alter.c,
for improved OOM reporting.

FossilOrigin-Name: 57555d75daa2ee8345f8329749841a322b3e57679e5c4899ef749c8bc814812d
2025-11-20 11:06:58 +00:00
drh
d7e7ab7b5f Additional checks for OOM conditions.
FossilOrigin-Name: 8fafd4988bf1fa1aa799c2834dd31bebdd52e7ae8e68c0197ccb497eb9b1e5f6
2025-11-20 02:03:57 +00:00
drh
6cb88552bc Mark an unreachable branch with NEVER().
FossilOrigin-Name: df2259a32fd65986eafceb2c551e6e1661927f1f5b18dbb97c59d9627279eea0
2025-11-20 00:56:28 +00:00
drh
325a361d5a Call sqlite3OomFault() rather than setting db->mallocFailed directly.
FossilOrigin-Name: 4fd5dfa215f14b20ddfc55904acbcc9bc9fd2123bb06fff72ef76efa17304566
2025-11-19 23:11:56 +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
57b61bf78f Improved comments in code. Omit unneeded wrapper functions.
FossilOrigin-Name: 3485c7c81bee8e98ea6b403438bcdb2b6fa058afeafea150ce1c859345e1529b
2025-11-19 15:25:18 +00:00
dan
3a4c9daa5c Strip unterminated "--" comments from the end of constraints added using ALTER TABLE ADD CONSTRAINT or ADD NOT NULL.
FossilOrigin-Name: c73ab47b0250c01f1ffa6e506793769744ebeb8ca7edbb78de9a08db2037d6de
2025-11-19 11:31:59 +00:00
drh
b58ccaea8a Clarification to the header comment on dropConstraintFunc(). No changes
to code.

FossilOrigin-Name: 4bd53fbb20d78de7bbff1154e7ee1321b93b0ede435e150ad4ee992a4108ad5a
2025-11-19 11:28:48 +00:00
drh
7423111fe1 Trivial simplification to the ALTER TABLE ADD CONSTRAINT code.
FossilOrigin-Name: 383965b3ba701d3627e0bbd09ad04d0ce00d4721497d82e241dc7cffa745b1d9
2025-11-19 10:26:49 +00:00
drh
ec047587e3 Merge the latest trunk changes into the alter-table-constraints branch.
FossilOrigin-Name: 31d7aeeaef20ac42c3c395dbaf7a8225ac718256a4cbeb7c198d1c7361766b1b
2025-11-18 19:36:45 +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