Query Version History
Last updated November 13, 2026 · By the SaturnSQL team
Pro plan feature
Query version history is part of SaturnSQL Guard. See the pricing page for plan details.
Version history turns saved queries from a single editable file into a tracked artifact. Every save is recorded with a timestamp and the editor’s name, you can compare any two versions side by side, and you can roll back to an earlier version when something goes wrong.
For teams sharing a query library, this is the difference between "who changed the daily revenue query last Tuesday and why is it broken now" and "here is the diff, here is the author, here is the previous working version."
How versions are saved
A new version is recorded each time a saved query is edited and saved. The mechanics:
- Edits in the editor do not create versions until you save. Each save that changes the SQL or the variables produces a version; a rename or a move to another folder does not.
- Restoring an older version also produces a version, so the history shows the restore itself.
- Each version captures the full SQL text, not just a diff, so you can always retrieve the exact query that ran at any past point.
- Versions record who saved (the editor’s name) and when (a UTC timestamp shown in your local timezone).
You do not need to do anything to opt in. As soon as your workspace is on the Pro plan, history starts accruing automatically.
Viewing history
Open a saved query and choose Version history from the ⋯ menu above the editor. The panel lists every saved version, newest at the top, with the editor’s name and the relative timestamp ("2 hours ago", "3 days ago"). Select a version to see the SQL as it existed at that point, side by side with what is in the editor now. The arrow keys move through the list.
Comparing versions
In the history panel, select a version and pick what to compare it with: the editor now, or any other version. The two are shown side by side, and the diff highlights:
- Lines added in the newer version (green)
- Lines removed (red)
- Lines changed (modified)
Common use: a scheduled query started returning unexpected numbers. Diff the last working version against the current one to see exactly what changed, and decide whether to keep the change, fix it, or roll back.
Restoring an older version
Select a previous version and choose Restore. Restore does not delete the versions between then and now; it creates a brand-new version on top of the history whose contents match the older one. Nothing is lost: the intermediate versions remain in history, and you can compare or restore them later if needed.
Tip: Before restoring, add a quick note about why (in the query description or a Slack message to your team). Otherwise teammates see a sudden change and wonder where it came from.
Who can see history
History is team-wide: anyone who can open the saved query in the editor can see its version history, including who made changes. There is no private branch; the workspace is a shared source of truth. This is on purpose, the goal is shared context, not silos.
Restoring follows the same rule as editing: only the query’s owner can restore a version, and only when the editor has no unsaved edits, so nothing in progress is overwritten. Viewers do not see SQL anywhere in SaturnSQL, so they do not see version history either.
Retention
SaturnSQL keeps the 500 most recent versions of each saved query for as long as your team is on the Pro plan. For most teams, that means months or years of edits are visible.
Contact us if you have specific compliance requirements.
When you would actually use this
The most common scenarios from teams using SaturnSQL:
- A scheduled query started reporting weird numbers — diff against last week’s version to find the change.
- A teammate left and you do not understand their query — history shows the evolution, often making the intent clearer than the final state alone.
- You experimented with a complex rewrite and want to back out — one-click restore the previous working version.
- Compliance asks for the SQL behind a specific metric on a past date — pick the version that was current on that date.
Related help articles
- Saving and organizing queries
- Inviting team members
- AI SQL assistant
- Use case: collaborative SQL editor
Version history comes with the Pro plan