The dry run
Try it out runs the query without saving it. The button sits in the SQL editor and in the builder. Before it there was no such route: you saved and hoped, and a broken query showed up as a bad value on a board.
What the dry run proves
Section titled “What the dry run proves”The dry run takes the same guarded path a query tag takes in operation. No second door into the data:
- Read only. The query runs in a transaction that opens with
BEGIN READ ONLY. A write attempt is rejected by the database, not by a text scan. What you see on screen is that a query tag reads and must not write. - With a time limit. The dry run gets 3 seconds; a tag in operation gets 5. If the time is exceeded, the answer says so as a sentence — not as an empty table. A query that needs longer than three seconds is not one a board should stand on either.
- With real bind parameters. What you type into the parameter boxes goes to the database separately from the text.
- On real data. Which is why it does not run as you type, but only when you ask for it.
What comes back
Section titled “What comes back”On success: the columns, the rows and the duration in milliseconds. At most 50 rows are shown; if there are more, it says so. A dry run answers “does this do what I meant”, and that never needs the whole table.
Check two things while you are there: that the query runs, and that it returns the column the
widget is looking for. For a key figure that is Value.
No rows is an answer, not a failure. When it says the query ran and this selection has nothing in it, then the query is right and the period or the filter is empty. A failure is stated as a sentence, never as an empty table.
When it does not run
Section titled “When it does not run”The syntax check is the database itself, not a parser of ours. PostgreSQL answers with a message and a character position, and that position becomes the marker under the word it points at.
Two cases look different:
- An unknown name.
"Foo.Bar"that is not a field of this tenant is refused before the database is reached — naming the name, with a marker at its place. - A write attempt. Refused, and named as what it is.
Who may do this
Section titled “Who may do this”The dry run executes arbitrary read SQL. That is for whoever administers the tenant — exactly the circle that may write a query tag in the first place.