Commit Graph

141 Commits

Author SHA1 Message Date
drh
bf057073c3 Rework the ".indexes" command of the CLI. (1) The PATTERN now matches
the name of the index itself, not the name of the table containing
the index, thus making the pattern actually useful.  (2)  System-generated
indexes (for UNIQUE constraints and similar) are omitted unless
the -a|-all or --sys options are added.  (3) The --expr option causes
only expression indexes to be shown.

FossilOrigin-Name: 13e2cad810bfd59a9e18eb38bda1241715b76756ffec7d617e9ce99b89f19284
2026-03-16 15:35:41 +00:00
drh
3bd23b0d78 Fix the behavior dot-commands that appear as command line arguments to the
CLI so that their effect persists into subsequent commands on the command
line.  This fix also improves error messages caused by command line
arguments. 
[forum:/forumpost/2026-03-10T19:26:06z|Forum post 2026-03-10T19:26:06z].

FossilOrigin-Name: ff084ae341eab5c4ce9403defee03adc448c05f77648a954f0942a38f640080b
2026-03-10 21:01:59 +00:00
drh
ea6b2a87d1 Disable test shell1-5.0 as it is causing a use of initialized deep inside
of TCL.

FossilOrigin-Name: 440bd6091e3767f0a2f42ffdc92ca5e4736c0a73324fdd15397c3b5dbbc31fb8
2026-03-02 13:43:08 +00:00
drh
213262fa53 Enhance the ".timer" command in the CLI to accept the "once" argument, and
so that it leaves its last real-time result in the $TIMER variable.  Also
fix a harmless warning from an earlier check-in.

FossilOrigin-Name: 8ad7dffc261cbb3f7c9b4d38b04282c805c1c047fb431076f85e577c81f21574
2026-02-01 15:58:37 +00:00
drh
fb795dbe73 Fix error messages associated with .import, along with corresponding
test cases.

FossilOrigin-Name: 2084e805d0d9da8f419b8506fccd652a7d20262bd95729250a2d2eabfdd079ad
2025-12-29 21:39:48 +00:00
drh
ce43bf85fa Back out the --compat option from the CLI.
FossilOrigin-Name: 850d5dbfb0f1eacd1e5213759810ec7e5eba4fcc0b2718dabccd5b269b126f1c
2025-12-13 00:13:40 +00:00
drh
85fb541ac0 Various improvements to the .mode command of the CLI, and especially to how
it handles the --limits option.

FossilOrigin-Name: f883b854976d2aa679c87edce3b577f38b5fa518f707706320d1ddb38365e2dd
2025-12-10 19:04:49 +00:00
drh
4a33eed6e9 Remove #ifdefs intended to make SQLite compatible with Windows RT. WinRT
was short-lived and has been discontinued for a long time.

FossilOrigin-Name: 108691a3cb2f296f0ede06c34271ee185f299bfd76e97a1bd06c730a28d94ff4
2025-12-06 19:56:40 +00:00
drh
5fb9d599ed Update test cases to work with the new box format and with --quote relaxed.
FossilOrigin-Name: e3f442d08f455e0aa260cc8db4922a5f611e17afe71b0bb251328ab4b3ad46ca
2025-12-06 11:02:14 +00:00
drh
d9b165b27a Fix recently added test cases for Windows.
FossilOrigin-Name: bccc0d65b0fb617f6c8eb111b6717d3ad419f80d3495dc5c6a69ccd0771b3d9d
2025-12-03 02:48:36 +00:00
drh
25ca71daac Improvements to the ".schema indent" logic.
[forum:/forumpost/c8136b1bd0|Forum post 2025-12-02T19:04:04Z].

FossilOrigin-Name: 71ea7f38ffd0648c58713d8be5d2f5536f926ec21a0adc3c2a8a9a7ba8ea3826
2025-12-02 19:55:39 +00:00
drh
110d452cad Fix a CLI test case due to a change in error message text.
FossilOrigin-Name: cf45d534d63878b00d949234e81cf9c67db7d7067bbac2fd5cd1780463fcce06
2025-11-27 10:57:06 +00:00
drh
95f643c27d Do not omit the beginning and ending margins when setting bBorder to QRF_Off,
except when the margins need to be squeezed to fit.  Those extra margins give
a more pleasing appearance, and also make the output the same as psql.

FossilOrigin-Name: 2892aaeed9f55ad87791491068493c2e530eeff4194d156f16745d185760797c
2025-11-26 21:56:55 +00:00
drh
80c1010f88 Add the bBorder option to the QRF spec. Reflect this in the -border
option on the TCL format method, and the --border option to ".mode"
in the CLI.  Also add the "psql" mode to the CLI.

FossilOrigin-Name: 02cbeb69884cd884d9b1b5f59c4168a3dc24b1a5aecc6967586c0be350b10574
2025-11-26 16:21:56 +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
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
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
f4870a2b51 Improved --safe mode defenses. Fix a test case error.
FossilOrigin-Name: eacc9db80de8baa878ebdc3a054538c8998db9a2e46720c0d8b109d62a0cac29
2025-11-16 01:34:01 +00:00
drh
d5ee8aa625 Fix various bugs and compiler warnings. All tests now passing on linux, mac,
and windows.  More testing needed, though.

FossilOrigin-Name: 2220cb70c2f1ee30dcdf917a20feacdfcb3789433d0645fea626fd4c5cf0d099
2025-11-14 13:07:45 +00:00
drh
c37fcdd5d1 Improvements to --titles handling in the .mode command. Fix shell1 test
cases having to do with quoting of NULL values in "tcl" mode.

FossilOrigin-Name: 0fef770bd654b8ba8011b0bb610128058e75e8444f86c51e7ea59a6f2625a3fc
2025-11-14 02:22:39 +00:00
drh
a9136b45fa Continuing code cleanup. Various minor bug fixes. All legacy tests now
pass.  All planned features for ".mode" are implemented, at least at the
interface level, though some features are still no-ops.

FossilOrigin-Name: e5a81711d0076b447e5bd3206bc04d755a6229b9f4926f42260fcd01ecf3e5a2
2025-11-12 18:54:09 +00:00
drh
7f947dbd6c Move the ".output" command into a separate subroutine. Enhance .output so
that it is able to capture output in a sqlite3_str object, then compare that
captured output we patterns to accomplish tests.

FossilOrigin-Name: ddd167044753f5215624fc9ee0e3657836c528f23a6a3e262401fd1b64cdbb21
2025-11-11 14:08:50 +00:00
drh
09f16c5ab6 Add the bTextNull field to sqlite3_qrf_spec. Use QRF to implement "tcl"
mode in the CLI.

FossilOrigin-Name: 2ba92320db3c16c3c91e29ea935ae92da546261f25846d242bd2dd27e0b7e032
2025-11-10 12:32:04 +00:00
drh
e2201e40ce Fixes to autoExplain
FossilOrigin-Name: 38e4171697057437fc9f70f8734c7f557b91da47804ff10b3d2481802377222f
2025-11-10 00:18:36 +00:00
drh
3e98ff6b1d Remove about a thousand lines of dead code from shell.c.in.
FossilOrigin-Name: efbcc7decd5347e3460cc3ed62720c8c3932225dfdf92293a990c51895450906
2025-11-08 23:35:57 +00:00
drh
ec27a2e7e5 Fix some problems. But there is a need to do major surgery on the
table layout algorithm, so it seems good to snapshot before proceeding.

FossilOrigin-Name: 9052991a897ad12ac54476d9a370d1ad18937abc3c3fc11efcb678f21cb5ef69
2025-11-07 19:20:49 +00:00
drh
d2424338b0 Incremental check-in. QRF is working, but there are many test failures
in the shell test modules.

FossilOrigin-Name: de7fc9afc43d4bd5f5995832cd698633e0e7213c190fa044856c9f82512161f9
2025-11-07 17:48:14 +00:00
drh
1c19c06246 Fix the output of ".dump" in the CLI so that the sqlite_sequence table
is created using correct syntax.

FossilOrigin-Name: 4b9f2e1d4485ad3baf9285aa09b468469be929b18cb308f19af471d7aac66076
2025-10-31 11:23:44 +00:00
drh
139ec38ac8 Further improvements the ".dump" command to handle corner cases.
FossilOrigin-Name: cd0c77934ff32050380c2143bba7d4e6c07d5f08187cb5d5e8e7602854d1cda8
2025-10-30 18:52:48 +00:00
drh
c5ff2aa7cf Fix the CLI ".dump" command so that it does not make duplicate
sqlite_sequence table entries as described in
[forum:/forumpost/b1674b56ad|forum thread b1674b56ad].

FossilOrigin-Name: c833f26a6780f919551e50c67d308e96293cec8481899354411d805617481f24
2025-10-30 11:39:49 +00:00
dan
9b6bc61dbd Fix some integer overflow warnings in the base64 and base85 extensions.
FossilOrigin-Name: 06b4bd2aba22c57f5a5fed606c3bee225dee6fdc13bb16cc58194040ef0d7d85
2025-10-07 15:14:03 +00:00
drh
dc868ef879 Convert the ShellText object in the CLI to use sqlite3_malloc64() rather than
plain malloc().  Avoid unnecessary quoting of table names in .dump output
and similar.  Improved detection of OOM in set_table_name().

FossilOrigin-Name: 6ce4f6dc15a575c318669051fe6590ad114b52ff3f3e260cdf7accccdd922d63
2025-09-25 10:55:54 +00:00
drh
2c88a2ffb5 Rework the set_table_name() function in the CLI to use modern APIs.
[forum:/forumpost/2baa4acd64|Forum post 2baa4acd64].

FossilOrigin-Name: 821cc0e421bc14a68ebaee507e38a900e0c84ff6ba7ee95bf796cad387755232
2025-09-24 19:10:58 +00:00
stephan
2d49219b1c Correct two tests in shell1.test which were broken by the addition of new output in [0f11087b8475].
FossilOrigin-Name: 909dd0a02a967baef46c3efdca42a0ab4e15003e34ce7e9af82fce5f17213d7b
2025-03-28 16:31:54 +00:00
jan.nijtmans
d07045119d shell1.test: == => eq
FossilOrigin-Name: 99fdd19193056259d84768f46519328c300976b102f1b1e0b815720df01b28d0
2025-03-27 17:25:38 +00:00
drh
72b5c6db35 Avoid running test cases involving ANSI control characters or Unicode
on Windows in a slave interpreter, as that combination does not work.

FossilOrigin-Name: f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d
2025-03-11 15:46:23 +00:00
drh
b8ec04ee02 Fix a test case that was broken when the default --escape type was changed
by the previous check-in.

FossilOrigin-Name: 5f2531e068b4856db2270518c370b65cbd0c0ab5443d76f1fb1116fe9ad80296
2025-02-25 20:36:46 +00:00
drh
87ad172c50 Enhancements to help avoid problems in the CLI when trying display content
that contains ANSI escape codes:  (1) Add the --escape MODE option to the CLI
where MODE is one of "symbol", "ascii", "off" where the default is "symbol".
(2) Add the unistr() SQL function.  (3) Add the unistr_quote() SQL function.
(4) Add the %#Q and %#q conversions in the built-in printf.

FossilOrigin-Name: e3e509ae145ee2623ac68ededa59991a97fcd28313e03f67a3890b560c5381b0
2025-02-25 15:57:49 +00:00
drh
96a65cc474 Three different --escape modes: symbol, ascii, off.
FossilOrigin-Name: b5adb52fc0dc1838cb9c66cff422f2b8ec147e546cf909dd3c48731fa1edfe50
2025-02-24 00:18:12 +00:00
drh
8d15d7ed68 Work toward VT100-safe output from the CLI by default.
FossilOrigin-Name: 44c44620e8648a4265053f194e32b3a5c65d25b4f1fff61ef9b944e7cb0ed624
2025-02-23 20:20:56 +00:00
dan
c978e390e6 Fix release test errors on winrt.
FossilOrigin-Name: 39bebd50b80ceee321b1da837c72a20cdb26f06e4b726f23e3ddac877d9400a7
2024-12-16 19:31:30 +00:00
drh
17408fbbd8 An improved method for statically linking sqlite3_analyzer.exe using Tcl9.
Enable wildcard expansion of arguments to testfiture on Windows.

FossilOrigin-Name: 9b87ea219bce5689a69efac31063b9b11928e59124c0d36194715ff7faa5129d
2024-10-11 17:02:37 +00:00
drh
b7ceffdadf Fix shell test cases to account for recent additions to the ".help" output.
FossilOrigin-Name: 54c22bc6165affbea0d1166a0912d19939300ccc4ae33a6b2ed8c510ab61c574
2024-09-26 01:29:22 +00:00
drh
4400b0ac45 Fix a problem with strictly conforming UTF8 in shell1.test.
FossilOrigin-Name: 8ee187f98d310e1e7cf6c3fdf000c19e98a9f11e01436c3c407df04da79aa7c0
2024-07-31 02:01:19 +00:00
dan
2dbf276e93 Update mdevtest and sdevtest to do shell builds in parallel. And only if one or more of the tcl scripts run requires it.
FossilOrigin-Name: 6eae4547d4d50c798d1f05eaa1da02f4682d261dbd64e94748179923839024e6
2024-03-11 19:33:55 +00:00
larrybr
5d175eb020 Fix output redirect bug reported in [forum:/forumposts/cbf4933cfeee74bb|the forum].
FossilOrigin-Name: ce542fee6f0150bbd13505dcd26b21a9d1d23eb2dc8e78e63f9da6b4298ec028
2023-11-23 07:08:49 +00:00
larrybr
033127af75 Cherrypick shell1.test fix.
FossilOrigin-Name: 91c888eddbcb1b461f7d562c2f0eee57f1a2be7f9959b9d69e80fc7c1da20e9e
2023-11-20 00:21:24 +00:00
drh
aa040d891f Fix the shell1.test test so to align with the new behavior imposed by
[bce807cd48763273] - that backslash escapes only work without quoted arguments
in dot-commands of the CLI.

FossilOrigin-Name: 0db82b4281a0e0d5e365553df11e0347f60c00c861c0fb96227059edff3a0ef6
2023-10-23 02:01:14 +00:00
larrybr
d8200de04d Give CLI quoted args hex escapes (as documented.)
FossilOrigin-Name: 90e434a6ae370a35109802fc336b98298d345f3d23125ef2cc68c31d8e69bb50
2023-05-02 19:33:27 +00:00