Docs / Using SayQL

Run queries safely

SayQL is built so that pointing it at a production database isn't scary.

Read-only by default. SayQL checks every statement before it runs. Anything that could change data or structure (INSERT, UPDATE, DELETE, DDL and so on) stops and shows a confirmation first.

  • Run several statements: statements separated by ; run one after another, each in its own results tab. Each one that could change data asks first. The run stops at the first error, or at a change you decline, and its tab shows where it stopped.
  • Run part of a query: select some SQL in the editor and click Run selection (or press ⌘↵) to run only that. If the selection cuts a statement in half (say, a DELETE without its WHERE), SayQL runs the whole statement instead, highlights it, and shows Ran the full statement(s). A complete subquery inside brackets runs as selected. The same read-only checks apply. ↵ in the Ask box always runs the whole query.
  • Run when ready: while the AI is still writing, the button reads Run when ready. Click it, or press ↵, and the query runs as soon as it's written.
  • Above the editor, Save keeps the query as a script and Clear empties the editor.
  • Reads also run inside a read-only transaction (PostgreSQL and MySQL) or on a read-only connection (SQLite), so the database itself refuses writes. SQL Server has no read-only mode, so reads run in a transaction that's always rolled back. For production SQL Servers, use a login that can only read (db_datareader).
  • Results show up to 5,000 rows. Use LIMIT / TOP or filters for more focused results. Copy as CSV copies the rows shown.

Tabs and saved scripts

  • ⌘T opens a new SQL tab on the current database. Each tab keeps its own question, SQL and follow-up history.
  • ⌘S saves a tab as a script. Saved scripts appear under Saved scripts in the navigator and reopen on the database they were written for.
  • Closing a tab with unsaved SQL asks whether to save it first.

Something missing or unclear? Ask in Discussions.