ShortSQL
A real SQL database, inside one shortcut.
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+ functionsEncrypted databasesAES-256-GCM with a key only you know. Change it or turn it on any timePrivate databasesHidden from the console, for the shortcut that owns themBackup & restoreEvery database in one .ssql file. Move to a new iPhone in secondsHistoryYour last 20 queries, one tap to run againBeautiful resultsA clean table page in light or dark, or plain textDeveloper APIOne Run Shortcut action gives your shortcut a databaseFully offlineEverything runs on the device. Internet is only used to tell you about updates---
How it works
Run ShortSQL. That's the whole setup.
Tip: leave the prompt empty to open the menu. Type
USE shopto switch database,KEY secretto unlock one, orexitto close.
Everything in the menu
OptionWhat it doesBrowse a tableSee its rows, no SQL neededDescribe a tableColumns, types, keys and defaultsHistoryRerun one of your recent queriesSwitch databaseOpen, create, or delete several at onceEnter key · EncryptionUnlock, encrypt later, change the key or remove itBackup & restoreSave one or all databases, or bring them backSettingsPage or text, appearance, start-up, rows shown. Every change is confirmedHelpA full SQL reference, built inWhat's newRelease notes for every versionDevelopersAPI guide, a copy-ready JSON template, the ShortSQL StarterSupportDiscord 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 SELECTandLIKE),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,UPDATEandDELETEwithORDER 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,UPDATEandDELETErun as a few native actions, so big tables stay quick.
Your data, locked down
CREATE DATABASE vault ENCRYPTEDencrypts 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. PRIVATEdatabases 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:
- Text with a JSON request (or a Dictionary)
- Run Shortcut →
ShortSQL - Get Dictionary from Input → read
rows,affectedorerror
{
"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 }
]
}
FielddbrequiredDatabase namequeryrequired*One statement, or a ; script that saves all or nothingparamsoptionalA value for each ?, quoted safely: quotes, emoji, line breakskeyoptionalFor encrypted databasestable + rowsoptionalBulk insert, instead of a querycheck_updatesoptionalfalse keeps your shortcut 100% offlineReplyok``true, or false with an error messagerows · 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 funTelegramUpdates and bug fixes, straight to you---
ShortSQL · Developed by Anup
What's New
First release
What it does
4,323 actions-
If
-
Text
-
Set VariableRENDER_JS
-
Text
-
Set VariableICON_DB
-
Text
-
Set VariableICON_TABLE
-
Text
-
Set VariableICON_HIST
-
Text
-
Set Variableckey
-
Text
-
Set Variablegomenu
-
Text
-
Set Variablegopick
-
Text
-
Set Variablecdb
-
Get File
-
If
-
Text
-
Get Dictionary from Input
-
If
-
Text
-
Get Dictionary from Input
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_html
-
If
-
Text
-
Set Variables_html
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_theme
-
If
-
Text
-
Set Variables_theme
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_start
-
If
-
Text
-
Set Variables_start
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_rows
-
If
-
Text
-
Set Variables_rows
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_lastdb
-
If
-
Text
-
Set Variables_lastdb
-
Get Dictionary Value
-
Match Text
-
If
-
Set Variables_updates
-
If
-
Text
-
Set Variables_updates
-
Match Text
-
If
-
Format Date
-
Get File
-
Text
-
Text
-
Match Text
-
If
-
Text
-
Save File
-
Text
-
Get Dictionary from Input
-
Set Variableupd
-
Dictionary
-
Set Dictionary Value
-
Set Dictionary Value
-
Set Dictionary Value
-
Replace Text
-
Replace Text
-
Text
-
Make Rich Text from HTML
-
Set Name
-
Set Name
-
Replace Text
-
Set Variable_jsr
-
Match Text
-
If
-
Text
-
Make Rich Text from HTML
-
Set Name
-
Set Name
-
Replace Text
-
Set Variable_jsr
-
Match Text
-
If
-
Text
-
Make Rich Text from HTML
-
Set Name
-
Set Name
-
Replace Text
-
Set Variable_jsr
-
Replace Text
-
URL Encode
-
Match Text
-
If
-
Get Dictionary from Input
-
Set Variableupd
-
Get Dictionary Value
-
Match Text
-
If
-
Get Dictionary Value
-
Text
-
Set Name
-
Get Contacts from Input
-
Choose from List
-
Text
-
Match Text
-
If
-
URLhttps://discord.gg/sS5Wqa4TNp
-
Open URLs
-
Stop This Shortcut
-
Match Text
-
If
-
URLhttps://t.me/ios_shortcuts
-
Open URLs
-
Stop This Shortcut
-
Get Dictionary Value
-
Match Text
-
If
-
Match Text
-
If
-
Get Dictionary Value
-
Match Text
-
If
-
Get Dictionary Value
-
Show AlertUpdate required
-
Get Dictionary Value
-
URL…
-
Open URLs
-
Stop This Shortcut
-
If
-
Get Dictionary Value
-
Text
-
Text
-
Set Name
-
Get Contacts from Input
-
Choose from List
-
Text
-
Match Text
-
If
-
Get Dictionary Value
-
URL…
-
Open URLs
-
Stop This Shortcut
-
Text
-
Match Text
-
If
-
Get File
-
If
-
Set Variablecdb
-
If
-
Dictionary
-
Set Dictionary Value
-
Set Dictionary Value
-
Set Dictionary Value
-
Text
-
Set Dictionary Value
-
Run Shortcut
-
Get Dictionary from Input
-
Get Dictionary Value
-
Repeat with Each
-
Get Dictionary Value
-
Combine Text
-
Match Text
-
Repeat with Each
-
Text
-
Combine Text
-
Text
-
Set Name
-
Get Contacts from Input
-
Choose from List
-
Text
-
Match Text
-
If
-
Text
-
Set Variablegomenu
-
Match Text
-
If
-
Dictionary
-
Set Dictionary Value
-
Set Dictionary Value
-
Set Dictionary Value
-
Text
-
Set Dictionary Value
Ratings & Reviews
Write a ReviewNo reviews yet. Be the first to share what you think!