Write & reuse SQL
Save useful SQL and recover earlier versions.
Keep named workspace scripts, saved history, local copies, file revisions, and shared scripts in their intended scopes.
Availability depends on the desktop build and selected database.
How it works
Give a script a name and context, save it in the right library, then review versions before restoring.
A quick walkthrough
- Choose workspace, local, file, or team scope before saving.
- Review a diff before restoring; loading SQL does not execute it.
Default shortcuts
Named library entries, saved SQL history, and local files are managed separately; save shortcuts have distinct destinations.
| Action | Windows / Linux | macOS | Focus and effect |
|---|---|---|---|
| Open SQL Script Library | No dedicated default | No dedicated default | Open from AI & Sql Editor or the history-list menu; library entries, saved history, and files are managed separately. |
| Save SQL to saved history | Ctrl+S | ⌘+S | Focus the SQL Editor to save to its workspace saved history; this is separate from saving a .sql file or publishing a team script. |
| Save the SQL file | Ctrl+Alt+S | ⌘+⌥+S | In the SQL Editor, write or choose a local .sql file; check the overwrite destination. |
| Load a SQL file | Ctrl+Alt+Shift+L | ⌘+⌥+Shift+L | Load a local file into the SQL Editor without automatically executing it. |
| Save or revise a Workspace Library entry | No dedicated default | No dedicated default | Save, revise, or restore inside the library dialog; no dedicated default is assigned. Restoration does not run SQL. |
- Settings → Shortcuts shows configurable bindings; customized keys take precedence. Fixed dialog keys and mouse gestures may be managed by their own controls.
- On macOS, ⌘ means Command and ⌥ means Option. Function keys may require Fn. Delete means forward delete (often Fn+⌫ on a compact Mac keyboard); use the menu when Insert is unavailable.
Objects in this workflow
What to know
- Local libraries and file snapshots keep up to 100 prior versions.
- Workspace packages do not include SQL libraries or file-version snapshots.