Skip to content

Universal SQL

Not every database DBCode connects to has a SQL engine. Document stores speak query documents, key-value stores speak commands, and API-backed services speak REST. Universal SQL lets you use the SQL you already know against these connections anyway: DBCode parses each statement and translates it into the database’s own operations. A WHERE clause becomes a native filter or an API parameter, ORDER BY becomes a native sort, LIMIT becomes native paging.

The filtering is genuine pushdown. DBCode does not fetch everything and filter rows in the editor; the condition travels to the server, so the database does the work and only matching rows come back.

SELECT name, email, status
FROM customers
WHERE status = 'active' AND createdAt >= '2026-01-01'
ORDER BY createdAt DESC
LIMIT 20;

No SQL text reaches the database; the statement runs as a native query.

Each database supports the subset of SQL its engine or API can actually serve, and its own page documents that subset precisely - see Supported Databases. Anything outside the subset is rejected before it runs, with the construct named and its line and column reported, rather than approximated.

Every Universal SQL connection shares one SQL dialect. A database may serve a subset, but everything inside its subset behaves the same way everywhere.

StatementNotes
SELECTNamed columns or *, from a single table or collection
SELECT COUNT(*)Server-side count
INSERTSingle row, explicit column list
UPDATE ... SETWith an optional WHERE
DELETEWith an optional WHERE
GroupOperators
Comparison=, !=, <>, >, >=, <, <=
PatternLIKE with %text%, text%, %text, or plain text (exact match); NOT LIKE with %text%; ILIKE (case-insensitive)
MembershipIN (...), BETWEEN low AND high
Null testsIS NULL, IS NOT NULL
CombinatorsAND, OR, parentheses
SELECT * FROM orders
WHERE status IN ('pending', 'paid')
AND total BETWEEN 100 AND 500
AND cancelledAt IS NULL;
SELECT * FROM products WHERE name LIKE '%sensor%';

Primary key lookups fetch the named records directly:

SELECT * FROM payments WHERE id IN ('pay_001', 'pay_002');

ORDER BY, LIMIT, OFFSET, and COUNT(*) are part of the core, executed by the database:

SELECT COUNT(*) FROM sessions WHERE lastSeen >= '2026-07-01';

Write dates as ordinary string literals. DBCode types the comparison from what it knows about the column, so '2026-01-01' compared against a date column behaves as a date, not as text:

SELECT * FROM charges
WHERE created BETWEEN '2026-01-01' AND '2026-03-31'
LIMIT 100;
  • Comments: --, //, #, and /* ... */ are all recognized
  • Quoted identifiers: wrap a field name in double quotes when it contains spaces or unusual characters, for example SELECT "unit price" FROM items
  • Multi-statement scripts: separate statements with semicolons; each statement is translated and executed on its own, and error positions point into the original script

Where the database is writable, INSERT, UPDATE, and DELETE translate to the native write operations:

INSERT INTO users (name, email, status) VALUES ('Ada', 'ada@example.com', 'active');
UPDATE users SET status = 'inactive' WHERE email = 'ada@example.com';
DELETE FROM users WHERE status = 'inactive';

The same safety net that guards SQL connections guards these: an UPDATE or DELETE without a WHERE clause goes through Missing WHERE Detection, so depending on the connection’s role it asks for confirmation or is denied outright. Read-only connections reject writes.

SQL does not replace a database’s native language, it sits beside it. Where a connection has its own query language, an editor cell whose first non-comment line starts with SELECT, INSERT, UPDATE, or DELETE runs as SQL; anything else runs in the native language, exactly as before. Native queries and SQL can share the same workflow, and each runs the way it was written.

DatabaseStatementsHighlights
MongoDBSELECT, COUNT(*), INSERT, UPDATE, DELETEServer-side filter, sort, and paging; typed date comparisons; _id strings match ObjectIds automatically
StripeSELECTDate ranges, resource equality filters, direct id lookups, and Search API pushdown over the Stripe API

Each link goes to that database’s Supported SQL reference, which states exactly which statements and filters it serves. More databases adopt the same engine over time.