Skip to content

Finding a value in the database

One Find window searches data wherever it is: the grid in front of you, one table, or a whole database. It lists every match and takes you to the row it is in.

To open it:

  • Press Ctrl+F in a grid — on the Data tab, or in the results of a query on the SQL tab. It opens on that grid.
  • Right-click a database or a table in the tree and choose Find..., or select it and press Ctrl+F. It opens on that database or table.
  • Or choose Database → Find in Database... from the main menu.

Type what you are looking for and press Enter or click Find.

Where to look

Look in offers what makes sense for where you opened the window:

Choice Searches
This grid The rows of the grid you opened it from, as the grid shows them — its filter and its sort order. It works on query results too.
Table Every row of the table, whatever the grid is showing.
Database Every table of the database, and of the databases attached to it.

Columns... limits a grid or table search to the columns you choose.

How to match

Mode Finds
Contains Values with the text anywhere in them.
Whole value Values equal to the text. In a table or database search a number also matches as a number, so 42 finds the integer 42 even in a column with no declared type.
Starts with Values that begin with the text.
Regular expression Values the pattern matches. An invalid pattern is reported before the search starts.
  • Match case — upper and lower case must match. Off, case is ignored.
  • Whole words — the text must stand as a whole word, not be part of a longer one: kona finds Kailua-Kona but not Konakai.

% and _ are searched for as themselves, not as wildcards.

The box keeps your recent searches: open its list to pick one again. The list is kept between sessions.

The results

Each match is one line:

Column What it holds
Table The table the match is in (with the database name in front for an attached one), or what the grid shows.
Column The column that matched. A row matching in two columns is listed twice.
rowid / RecNo For a table or database search, the row's rowid, as the Data tab's rowid column shows it; a WITHOUT ROWID table shows its primary key here instead, as column=value. For a grid search, the grid's own row number, RecNo.
Value The part of the value around the match, with the match highlighted. A JSONB value is shown as JSON.

Double-click a match, or click Go to Row. A grid match moves the grid's cursor to that cell; a table match selects the table in the tree, opens the Data tab and puts the cursor on the row.

A grid search goes straight to the first match, and leaves the keyboard in the Find window: Esc closes it, Enter searches again.

Next and previous

F3 and Shift+F3 move to the next and previous match in the grid, with the Find window closed, using the last search's text and options.

Highlighting in the grid

A grid search highlights every occurrence of the text in every cell on screen. To remove it, press Esc in the grid, or right-click and choose Clear Highlight. It also goes when the grid's data is read again.

Things worth knowing

  • A table or database search runs in the background: the rest of the program stays usable, the status line says which table is being read, and Stop (or Esc) ends it.
  • A grid search reads the rows through the grid, so the rest of the program waits while it runs; Stop ends it.
  • Every search stops by itself after the first 1000 matches, and says so; narrow the search to see the rest.
  • A database search leaves out views, which would list rows their tables list already, and the internal tables of full-text and R-Tree indexes.
  • Changes inside a transaction you have not committed yet are not found by a table or database search until you commit. A grid search sees what the grid shows.

See also: Viewing table data · Editing table data · Working with JSON