SqlOtter
← All documentationWrite & reuse SQL

Write & reuse SQL

Save, reuse, and version SQL scripts

Keep named workspace scripts, saved history, local copies, file revisions, and shared scripts in their intended scopes.

What this feature does

Give a script a name and context, save it in the right library, then review versions before restoring.

When to use it

Use this when keeping named scripts, reusing saved SQL, or reviewing earlier local versions.

Illustration of named SQL entries, revisions, and separate storage scopes.
Conceptual workflow diagram; this is not a captured SqlOtter screen. Release-matched screenshots are still pending.

Before you start

Local libraries are device-specific. Team libraries need account and API access.

Default shortcuts

Named library entries, saved SQL history, and local files are managed separately; save shortcuts have distinct destinations.

Default shortcuts
ActionWindows / LinuxmacOSFocus and effect
Open SQL Script LibraryNo dedicated defaultNo dedicated defaultOpen from AI & Sql Editor or the history-list menu; library entries, saved history, and files are managed separately.
Save SQL to saved historyCtrl+S⌘+SFocus 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 fileCtrl+Alt+S⌘+⌥+SIn the SQL Editor, write or choose a local .sql file; check the overwrite destination.
Load a SQL fileCtrl+Alt+Shift+L⌘+⌥+Shift+LLoad a local file into the SQL Editor without automatically executing it.
Save or revise a Workspace Library entryNo dedicated defaultNo dedicated defaultSave, 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.

How to use it

  1. Open SQL Editor, then AI & Sql Editor > SQL Script Library.
  2. Choose a storage scope: workspace, local common history, file version, or team library.
  3. Save or load a named SQL item and check its tags and environment.
  4. Compare versions before restoring; loading SQL does not execute it.

What to expect

The SQL is stored in the chosen scope, and loading it only places text in the editor.

Limits and safety

  • Local libraries and file snapshots keep up to 100 prior versions.
  • Workspace packages do not include SQL libraries or file-version snapshots.

If something goes wrong

  • If a saved script is missing, check the active workspace and whether it belongs to history, Workspace Library, or a local file.
  • If revision controls are unavailable, confirm that the item has a prior saved version and that the current build supports version history.