SQLite command line tool (
sqlite3.exe) remembers the last 2000 executed commands. To repeat the last command, just press the
↑ key, to search for older ones — use
By default, SQLite stores the history file in the user's home directory and names it
.sqlite_history. It's in plain text, so you can view it in your favorite editor. If you prefer to save it elsewhere, specify the full path in the
SQLITE_HISTORY environment variable.
SQLite writes the history to a file when the console exits normally, so in case of the computer or CLI crash the commands executed since the last
sqlite3 launch will be lost.
History recording is not the only feature of the console. SQLite CLI makes it easy to import and export data or work with several databases at the same time. Debugging multi-line queries is quite a challenge, though.
Subscribe to keep up with new posts.