Query History
TablePlus keeps a history of the statements you send to the database for each connection. Open the History tab at the top of the left sidebar to see it.
The history includes:
- the queries you run in the SQL editor
- the statements TablePlus generates when you commit changes made in the GUI, such as editing rows or altering a table
- the statements run by User Management
Use the search field in the tab to find a query. Click the magnifying glass in the field to turn on Match Case, Match Whole Word or Use Regular Expression. The same options are in the search field of the Queries tab, which also looks inside the SQL of your saved queries: queries whose name matches show first, and queries whose SQL matches are added when the search finishes.
If your license owner has turned query history off, TablePlus doesn't record it, and the History tab shows "Disabled by the license owner". See Deploy with MDM.

Reuse a query from the history
Double-click a query to insert it into a new SQL editor tab.
Right-click a query for more options:
| Option | What it does |
|---|---|
| Run | Opens the query in a new tab and runs it. |
| Copy | Copies the query to the clipboard. |
| Save As... | Saves the query to a .sql file. |
| Import... | Runs the query with the Import SQL Wizard. |
| Insert into SQL Editor | Inserts the query into a new SQL editor tab. |
| Show in Finder | Shows the history file in Finder. |
| Add to Queries | Saves the query to your saved queries. |
Log original values
To keep a record of the data you change, click the settings button next to the search field at the top of the History tab and turn on Log original values when updating or deleting data. When you commit an update or a delete, TablePlus then also logs the original values of the affected rows (as CSV) in the history, next to the statements.
Delete history
- To delete a query, right-click it and choose Delete, or select it and press
Delete. - To delete older queries of the connection, right-click a query and choose Clear History Older Than > 3 Months, 6 Months, 1 Year, 2 Years or 3 Years. TablePlus moves those queries to the Trash.
- To clear the whole history of the connection, right-click a query and choose Clear all History.
Keep history for a limited time
A large history makes the search slower. To keep only recent queries, click the settings button next to the search field of the History tab and choose Keep History > 1 Year, 2 Years or 3 Years. TablePlus asks before it moves the older queries of all connections to the Trash, then checks again once a day. The default is Forever - may slow down search.
When the history of a connection reaches 10,000 queries or 100 MB, TablePlus asks you once how long to keep it.