1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add support for using $XDG_STATE_HOME/sqlite_history or ~/.local/state/sqlite_history before fallback back to the historical default of ~/.sqlite_history. Update sqlite3.1 (man page) with the new semantics.

FossilOrigin-Name: 6b780655ccd68d068b6ee6621e56ac94c000916b7341651dc79725a0800cd1c0
This commit is contained in:
stephan
2025-06-30 15:21:46 +00:00
parent bbcf035954
commit 2752d1331d
4 changed files with 89 additions and 55 deletions

View File

@ -137,17 +137,37 @@ continue prompt = " ...> "
.sp
.fi
o If the file
o If the environment variable XDG_CONFIG_HOME is set then
.B ${XDG_CONFIG_HOME}/sqlite3/sqliterc
or
is checked, else
.B ~/.local/config/sqlite3/sqliterc
is checked. If the selected file does not exist then the fallback of
.B ~/.sqliterc
exists, the first of those to be found is processed during startup.
It should generally only contain meta-commands.
is used. It should generally only contain meta-commands.
o If the -init option is present, the specified file is processed.
o All other command line options are processed.
.SH HISTORY FILE
.B sqlite3
may be configured to use a history file to save SQL statements and
meta-commands entered interactively. These statements and commands can be
retrieved, edited and, reused at the main and continue prompts. If the
environment variable
.B SQLITE_HISTORY
is set, it will be used as the name of the history file, whether it
already exists or not. If it is not set but the XDG_STATE_HOME
environment variable is then
.B ${XDG_STATE_HOME}/sqlite_history
is used. If XDG_STATE_HOME is not set then
.B ~/.local/state/sqlite_history
is used. If the selected file does not exist then
.B ~/.sqlite_history
will be used as the history file. If any history file is found, it
will be written if the shell exits interactive mode normally,
regardless of whether it existed previously, though saving will
silently fail if the history file's directory does not exist.
.SH SEE ALSO
https://sqlite.org/cli.html
.br