ShortSQL

API • Updated 2 hours ago

Download Shortcut Add to Collection
Version 1.0 • 5 unique downloads

ShareShortcuts Member:

@uniquegaming



ShortSQL

A real SQL database, inside one shortcut.

OfflineAES-256SQLAPI

ShortSQL

Tables, joins, encryption and backups on your iPhone. No app to install. No server. No account. Your data never leaves your iCloud Drive.


At a glance

Real SQLJOIN, GROUP BY, subqueries, UNION, transactions and 60+ functions
Encrypted databasesAES-256-GCM with a key only you know. Change it or turn it on any time
Private databasesHidden from the console, for the shortcut that owns them
Backup & restoreEvery database in one .ssql file. Move to a new iPhone in seconds
HistoryYour last 20 queries, one tap to run again
Beautiful resultsA clean table page in light or dark, or plain text
Developer APIOne Run Shortcut action gives your shortcut a database
Fully offlineEverything runs on the device. Internet is only used to tell you about updates

How it works

Run ShortSQL. That's the whole setup.

Pick a database

Type SQL

See the result

Tip: leave the prompt empty to open the menu. Type USE shop to switch database, KEY secret to unlock one, or exit to close.

Everything in the menu

OptionWhat it does
Browse a tableSee its rows, no SQL needed
Describe a tableColumns, types, keys and defaults
HistoryRerun one of your recent queries
Switch databaseOpen, create, or delete several at once
Enter key · EncryptionUnlock, encrypt later, change the key or remove it
Backup & restoreSave one or all databases, or bring them back
SettingsPage or text, appearance, start-up, rows shown. Every change is confirmed
HelpA full SQL reference, built in
What's newRelease notes for every version
DevelopersAPI guide, a copy-ready JSON template, the ShortSQL Starter
SupportDiscord and Telegram

Real SQL. Not a toy.

CREATE TABLE expenses (
  id     INT PRIMARY KEY AUTO_INCREMENT,
  item   VARCHAR(80) NOT NULL,
  amount DECIMAL(10,2) NOT NULL,
  tag    TEXT DEFAULT 'other',
  spent  DATE DEFAULT (CURRENT_DATE)
);

-- Where did my money go this month?
SELECT tag, COUNT(*) AS times, SUM(amount) AS total
FROM expenses
WHERE spent >= DATE_FORMAT(CURDATE(), '%Y-%m-01')
GROUP BY tag
ORDER BY total DESC;

Everything that's supported

  • Databases: CREATE (plain, ENCRYPTED, PRIVATE), ALTER DATABASE … KEY / DECRYPT / PRIVATE / PUBLIC, SHOW DATABASES, DROP
  • Tables: CREATE (incl. AS SELECT and LIKE), ALTER (add, drop, rename, modify, change columns, rename table), DROP, TRUNCATE, RENAME, DESCRIBE, SHOW TABLES, SHOW CREATE TABLE, SHOW INDEX
  • Writing: INSERT (multi-row, SELECT, SET), INSERT IGNORE, REPLACE, ON DUPLICATE KEY UPDATE, UPDATE and DELETE with ORDER BY / LIMIT
  • Reading: JOIN, LEFT / RIGHT / CROSS JOIN, GROUP BY, HAVING, DISTINCT, ORDER BY, LIMIT / OFFSET, subqueries (IN, EXISTS, scalar, derived tables), UNION / UNION ALL
  • Expressions: CASE, CAST, BETWEEN, LIKE, REGEXP, IS NULL, <=>, DIV, MOD, INTERVAL
  • Constraints: PRIMARY KEY, AUTO_INCREMENT, UNIQUE, NOT NULL, DEFAULT
  • Transactions: BEGIN / COMMIT / ROLLBACK; any ; script is saved only if every statement succeeds
  • Functions: text (CONCAT, SUBSTRING, REPLACE, LPAD…), numbers (ROUND, ABS, POWER…), dates (NOW, DATE_ADD, DATEDIFF, DATE_FORMAT…), logic (IF, IFNULL, COALESCE…), totals (COUNT, SUM, AVG, MIN, MAX, GROUP_CONCAT)

Simple SELECT, COUNT, UPDATE and DELETE run as a few native actions, so big tables stay quick.


Your data, locked down

  • CREATE DATABASE vault ENCRYPTED encrypts every table with AES-256-GCM. The key is stretched with PBKDF2 (100,000 rounds), so guessing it is slow.
  • Change your mind later: ALTER DATABASE vault KEY 'new key' re-encrypts everything. It works on unencrypted databases too.
  • PRIVATE databases never show up in the console list.
  • Everything lives in iCloud Drive › Shortcuts › ShortSQL. Nothing is uploaded, ever.

Note: a lost key cannot be recovered. That's what makes it encryption.


Never lose a thing

Menu › Backup & restore saves one database, or all of them, into a single .ssql file. Keep it in Files, AirDrop it to a new iPhone, restore it there. Encrypted databases stay encrypted inside the backup.


For shortcut developers

Stop juggling text files. Give your shortcut a real database in three actions:

  1. Text with a JSON request (or a Dictionary)
  2. Run Shortcut → ShortSQL
  3. Get Dictionary from Input → read rows, affected or error
{
  "db": "myapp",
  "query": "SELECT id, title FROM notes WHERE done = ?",
  "params": [0]
}

Reply:

{
  "ok": true,
  "count": 2,
  "rows": [
    { "id": "1", "title": "Buy milk" },
    { "id": "2", "title": "Call mom" }
  ]
}

Bulk insert: many rows, one call, all or nothing:

{
  "db": "myapp",
  "table": "notes",
  "rows": [
    { "title": "Buy milk" },
    { "title": "Call mom", "done": 1 }
  ]
}
Field
dbrequiredDatabase name
queryrequired*One statement, or a ; script that saves all or nothing
paramsoptionalA value for each ?, quoted safely: quotes, emoji, line breaks
keyoptionalFor encrypted databases
table + rowsoptionalBulk insert, instead of a query
check_updatesoptionalfalse keeps your shortcut 100% offline
Reply
oktrue, or false with an error message
rows · countAfter a SELECT
affected · insert_idAfter INSERT, UPDATE, DELETE

ShortSQL Starter · View in Editor: install it from Menu › Developers for copy-ready blocks (setup, insert, select, update, bulk insert, encryption, private databases). The complete API guide is built into the console too.

Ideas to build

  • Notes and to-do apps with search, tags and due dates
  • Expense and habit trackers with monthly totals
  • Inventory, collections and reading lists
  • Settings storage for your own shortcuts: INSERT … ON DUPLICATE KEY UPDATE
  • Logs from automations, queried later with GROUP BY

FAQ

Do I need the internet?
No. Everything runs on your iPhone. When you happen to be online, ShortSQL checks once in a while for a new version.

Will updating delete my data?
Never. Your databases live in iCloud Drive, not inside the shortcut.

Can other people's shortcuts read my databases?
Any shortcut you run can call ShortSQL. That's how the API works. Use ENCRYPTED for anything sensitive: without the key, the data is unreadable.

What isn't supported?
Users and GRANT, views, triggers and stored procedures. It's a personal database with one request at a time, not a server.

Does the name matter?
Yes. Keep it named ShortSQL exactly, so other shortcuts can find it.


Support & community

DiscordChat, updates, bug fixes and weekend fun
TelegramUpdates and bug fixes, straight to you

ShortSQL · Developed by Anup



Changelog

v1.0
  • Version 1.0   Current
    2 hours ago (Changes)

Extensions:

Siri is supported

Show 1 embedded comment(s) in this Shortcut
Show External URL-calls / Webservices / Workflow URL schemes