Help › Write SQL

Keep queries as saved queries

Save a query tab under a name inside Querlyn, organize saved queries in folders, and open, rename, duplicate and delete them.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

A saved query is SQL you keep inside Querlyn under a name. Saved queries are listed in the sidebar under SAVED QUERIES, and with sync turned on they follow you to your other computers. To keep SQL as a file on disk instead, see Open and save SQL files.

Save a tab as a saved query

  1. In a query tab, press ⌘S on macOS or Ctrl+S on Windows and Linux (File › Save). In a tab that is already a file, choose File › Save to Saved Queries… instead.

  2. In the Save Query dialog, fill in:

    FieldWhat to enter
    NameA name to find it by. Two saved queries may have the same name.
    FolderOptional. Type a new folder's name, or choose one you have.
    ConnectionThe connection the query is meant for. It starts as the tab's connection; None is allowed. When it is the tab's connection and the tab is on another database than the connection's own, the query keeps that database too.
    Save only the selected textShown when text is selected. Ticked, the selection becomes a saved query of its own and the tab stays as it is.
  3. Choose Save.

The tab now belongs to the saved query: its title is the name, and ⌘S on macOS or Ctrl+S on Windows and Linux saves your later changes back. A dot on the tab means there are changes that are not saved yet.

Warning: A new tab that you never saved closes without a question, and its SQL is gone. Querlyn does not reopen your query tabs when it starts. Save the SQL you want to keep.

Open a saved query

ToDo this
Open itDouble-click it under SAVED QUERIES, or select it and press ↩ on macOS or Enter on Windows and Linux.
Open it in another tab, even if it is open already⌘↩ on macOS or Ctrl+Enter on Windows and Linux
Find it by name from anywhereView › Go to Tab or Saved Query… (⌘P on macOS or Ctrl+P on Windows and Linux), then type part of its name or its folder's.
Narrow the listType in the filter field above the list.

Opening shows the tab that already has the query, if there is one. Otherwise it uses the tab you are in when that tab is new and empty, and otherwise a new tab. The tab takes the saved query's connection, if that connection exists on this computer, and the database it was saved on; see Choose a tab's connection and database.

To put the keyboard in the list, choose View › Focus Saved Queries.

Rename, move, duplicate, copy and delete

Select a saved query and use its right-click menu, or these keys while the list has the keyboard:

ToCommandKey
Rename itRename Saved Query…F2
Put it in a folder, or take it outCommand Palette › Query: Move Saved Query to Folder…
Make a copyDuplicate Saved Query⌘D on macOS or Ctrl+D on Windows and Linux
Copy its SQL to the clipboardCopy Saved Query SQL⌘C on macOS or Ctrl+C on Windows and Linux
Delete itDelete Saved Query…⌘⌫ on macOS or Delete on Windows and Linux

Deleting asks first. If the query is open in a tab, the tab keeps its text and simply no longer belongs to a saved query.

Folders

Folders are one level deep, and a folder exists as long as a saved query is in it: to make one, type its name in Folder when you save or move a query. Folders are listed before the queries that are in none. Querlyn remembers which folders you closed.

Close a tab with unsaved changes

When you close the tab of a saved query whose text differs from what is saved, Querlyn asks Save changes to and the query's name, with Save, Don't Save and Cancel. ↩ on macOS or Enter on Windows and Linux saves and ⎋ on macOS or Esc on Windows and Linux cancels. Quitting asks once for all such tabs.

If you edit a tab back to the saved text, it closes without asking.

What is kept with a saved query

The name, the folder, the SQL, and which connection and database it is meant for. Never a password. Folded parts, the cursor and chart settings are not kept.

Help for Querlyn 0.1.0. All help topics