Help › Write SQL

Find and replace

Search the SQL in a tab as you type, with case, whole-word and regular-expression options, and replace one match or all of them.

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

Find and replace work on the text of the tab you are in.

Find

  1. Press ⌘F on macOS or Ctrl+F on Windows and Linux (Edit › Find). A bar opens above the editor. If you had text selected on one line, the bar starts with it.

  2. Type. The first match from where the cursor was is selected as you type, and every match is highlighted. Beside the field, the bar counts them: "2 of 14", or "No results".

  3. Move between matches:

    ToPress
    Go to the next match↩ on macOS or Enter on Windows and Linux in the bar, or ⌘G on macOS or F3 on Windows and Linux
    Go to the match before⇧ on macOS or Shift on Windows and Linux and ↩ on macOS or Enter on Windows and Linux in the bar, or ⇧⌘G on macOS or Shift+F3 on Windows and Linux
    Close the bar⎋ on macOS or Esc on Windows and Linux

⌘G on macOS or F3 on Windows and Linux and ⇧⌘G on macOS or Shift+F3 on Windows and Linux also work while the keyboard is in the editor. If the bar is closed, they open it.

Three buttons in the bar change what counts as a match:

ButtonShortcutFinds
Match case⌥⌘C on macOS or Alt+C on Windows and LinuxOnly text in the same upper and lower case.
Whole word⌥⌘W on macOS or Alt+W on Windows and LinuxOnly whole words: id does not match in order_id.
Regular expression⌥⌘R on macOS or Alt+R on Windows and LinuxWhat the pattern describes. If the pattern is not valid, the bar says what is wrong with it.

A regular expression matches within one line.

Replace

  1. Press ⌥⌘F on macOS or Ctrl+H on Windows and Linux (Edit › Replace). The bar opens with a second field, Replace. ⇥ on macOS or Tab on Windows and Linux moves between the two fields.

  2. Type what to find and what to put in its place.

  3. Choose:

    ButtonWhat it does
    ReplaceReplaces the selected match and goes to the next (Command Palette › Editor: Replace Next Match). ↩ on macOS or Enter on Windows and Linux in the Replace field does the same.
    AllReplaces every match (⌥⌘↩ on macOS or Ctrl+Alt+Enter on Windows and Linux). One step to undo.

With Regular expression on, the replacement can use what the pattern captured: $1 for the first group in parentheses, ${name} for a named group.

Other ways to find

  • To change every occurrence of a word by typing once, select them all with ⇧⌘L on macOS or Ctrl+Shift+L on Windows and Linux; see Edit in several places at once.
  • To rename an alias or a WITH query everywhere it is used, and nowhere else, see Refactor a query.
  • In the results, ⌘F on macOS or Ctrl+F on Windows and Linux filters rows; see Sort and filter results.

Find works in one tab at a time. There is no search across tabs or files.

Help for Querlyn 0.1.0. All help topics