Skip to main content

Query History

Every query you execute is automatically saved to a local SQLite database. Search with full-text search, filter by connection or time range, and re-run past queries. History persists across sessions.
Query History
Click View > Query History, press Cmd+Y, or click the History icon in the toolbar. Recent queries also appear in the sidebar. The history panel shows your executed queries with execution time, status, and database. Sort by time (most recent first), duration, or query text. Filter by connection, status (success/error), or time range (today, week, month, all time).
History panel with filter controls

Searching History

Type in the search box to find queries containing specific text:
SELECT users  -- Find all queries containing "SELECT" and "users"
History search

Using History

Re-running Queries

To re-run a query from history:
  1. Find the query in the history list
  2. Double-click the query
  3. It loads into the SQL editor
  4. Press Cmd+Enter to execute
Or right-click and select Run Query.

Copying Queries

To copy a query:
  1. Select the query in the list
  2. Right-click > Copy Query
  3. Or press Cmd+C
The full query text is copied to clipboard.
Query history context menu

Editing Before Running

To modify a historical query:
  1. Double-click to load into editor
  2. Make your changes
  3. Execute the modified query
The original history entry is preserved. A new entry is created for the modified query.

Query Details

Viewing Full Query

For long queries, click to expand and see the full text:
Query detail
Failed queries show the error message, the query that failed, and the timestamp. Load a failed query into the editor to fix and re-run.
Failed query entry with error message

Storage

Query history is stored in ~/Library/Application Support/TablePro/query_history.db (a local SQLite database with FTS5 full-text search). Configure retention in Settings > History:
SettingDefaultDescription
Max Entries10,000Maximum queries to store
Max Days90Delete queries older than this
Auto CleanupOnAutomatically remove old entries
To clear all history, open Settings > History and click Clear All History. For a specific connection, right-click it in the sidebar and select Clear History.