Skip to content

Query history

SQLite Expert remembers every script you run on the SQL tab, so a query you wrote last week is never lost.

To open the history: choose SQL → Query History, or right-click in the SQL editor and pick it there.

Each run is listed with:

Column What it holds
Run at When the run finished.
Database The alias of the database it ran against.
SQL The text that was run — the whole script, or the statement or selection, whichever was executed.
Took How long it took.
Rows changed How many rows it inserted, updated or deleted.
Result OK, Stopped, or Error: with SQLite's message.

The newest run is at the top.

Finding and reusing a query

Type in the box at the top to narrow the list. Every word you type has to appear somewhere in the query, the database name or the error message, in any order: customer city finds a query that mentions both.

  • Open in New Tab, or a double-click, puts the query into a new SQL tab. Nothing is run, and the tab you were working in is left alone.
  • Copy SQL copies it to the clipboard.
  • Delete removes the selected run; Clear All... empties the history.

The window can stay open while you work, and each run appears in it as soon as it finishes.

What is kept, and where

The history is kept in a file of its own, QueryHistory.jsonl, in the same Settings folder as the rest of SQLite Expert's settings. Each run is added the moment it finishes, so nothing is lost if the program closes unexpectedly, and two copies of SQLite Expert running at once both add to it without overwriting each other.

These are set under Tools → Options → Query History (see Changing options):

  • Record runs — on by default. The Record new runs switch in the history window is the same setting.
  • Record runs against encrypted databases — off by default. The history is plain text, and the values in a query can be exactly what the encryption protects, so runs against a database opened with a key are not recorded unless you turn this on.
  • Runs to keep — 5000 by default. Older runs are dropped as new ones arrive.

A script longer than 256 KB is recorded by its first 256 KB and marked (only the start was kept).

See also: Executing SQL scripts · Saving and loading SQL scripts