On a Mac the actions need macOS 14.2 or later. On macOS 13, use AppleScript.
The iOS app’s build is under Settings > About; it ships on its own schedule, see
iPhone and iPad.
Run a query on a Mac
1
Add the action
In a new shortcut, add Run Query and type the statement, such as
SELECT count(*) FROM orders.2
Pick the connection
Connection lists every saved connection whose External Clients level is not Blocked.
Database or Schema is optional and works as it does for the insert actions.
3
Choose the result
Set Result to the shape the next action needs.
Pick First Value for a count or a sum:
SELECT count(*) FROM orders hands the number straight
to Calculate or Show Notification. Pick Rows with Repeat with Each and Get
Dictionary Value. Every value arrives as text, NULL as null in JSON and as an empty field in
CSV, and binary as Base64. Two columns with the same name come back as id and id 2.
Row Limit defaults to 500 and goes up to 10,000. A statement stops after 30 seconds.
What a shortcut may do
The connection’s External Clients level and Safe Mode decide, exactly as for AppleScript.
A statement that drops or truncates always asks first, in a TablePro dialog that names Shortcuts.
Under a Safe Mode that confirms writes, the insert actions ask once for the whole batch. Every
statement goes to the history drawer under Shortcuts and to the execution audit log.
Add rows
1
Add the action
In a new shortcut, add Add Row to Table.
2
Point it at a table
Pick a Connection, then a Table read live from it. Database or Schema is optional and
lists schemas on PostgreSQL and the like, databases elsewhere; empty means the connection’s own.
SQLite has neither, so it stays empty there. When the connection cannot open, both pickers
show why, such as an SSH host key to check, instead of an empty list.
3
Supply the row
Feed Row (JSON or CSV) from a Shortcuts Dictionary action keyed by column name, which
builds the row without typing JSON. Add Rows to Table has Rows (JSON or CSV) and a
File field instead.
4
Run it
It returns the number of rows inserted, ready for a later step, and speaks “Added one row to
bookmarks.”
Data formats
Keys match columns by name. A column you leave out stays out of theINSERT and takes its default,
and an empty or null primary key is dropped for the same reason, so auto-increment still fires.
JSON
An object is one row; an array of objects is many, for Add Rows to Table.null inserts a SQL NULL, and numbers and booleans are inserted as text. Quote anything that has
to stay exact: a bare JSON number past 64-bit integer range is read as floating point and loses
digits, while "18446744073709551615" keeps every one.
CSV
The first row is the header and names the columns. Quoting follows the usual rules. A file can be UTF-8, UTF-16, Shift JIS, EUC-JP, GB 18030, Big5, EUC-KR or Windows-1252; the encoding is read from the file.Limits
Up to 10,000 rows per run. Add Rows to Table runs the batch in one transaction wherever the engine supports it, so a row that fails rolls back the whole batch instead of leaving half of it in. On a Mac, an engine without transactions keeps the rows that went in before the failure, and the error says how many. The action never joins a transaction that is already open: it stops instead.When it refuses
Nothing is inserted, except where the message says rows stay in.
On iPhone and iPad the action also fails while the device is locked, because it reads the
connection’s password from the Keychain.

