Database Syntax
OcaltQL has its own native database engine, built entirely for OcaltQL — not a wrapper around SQL, not a third-party library bolted on. Every database belongs to exactly one namespace and is never shared, linked, or exposed outside it.
Where databases live
Every database you create is stored inside your namespace at /root/db. This location is reserved by the platform — it cannot be browsed, listed, written to, or deleted through any file verb. The only way to interact with it is through the database verbs on this page and the next two.
Creating and removing a database
NEW DB "shopdb"
A database must exist before any table can be created inside it. NEW DB creates the database. Attempting to create a table inside a database that does not exist will fail.
DROP DB "shopdb"
DROP DB permanently deletes the entire database — every table, every row, every index inside it. This cannot be undone.
Stateless by design
OcaltQL database statements do not rely on a "currently selected" database the way some SQL clients do. Every statement names exactly which database and table it is operating on, every time:
SELECT ROWS FROM DB "shopdb" TABLE "people" SET ?results
This means two parts of a script running in parallel with AND can safely operate on different databases — or even the same one — without one branch accidentally affecting which database the other branch is reading from.
The WHERE clause
Filtering rows uses comparison operators built specifically for databases, all following the same "column" IS ... shape. Multiple conditions chain with AND (all must match) and OR (either may match).
| Operator | Matches when |
|---|---|
IS IDENTICAL TO / IS EQUAL TO | Value equals exactly. |
IS NOT IDENTICAL TO / IS NOT EQUAL TO | Value does not equal. |
IS GREATER THAN / IS LESS THAN | Numeric comparison. |
CONTAINS | Case-sensitive substring match. |
IS SIMILAR TO | Case-insensitive substring match — appears anywhere in the value. |
IS PREFIX SIMILAR TO | Case-insensitive match — value starts with this. |
IS SUFFIX SIMILAR TO | Case-insensitive match — value ends with this. |
IS NULL / IS NOT NULL | Column is missing or has no value, or does have one. |
IS EMPTY / IS NOT EMPTY | Column is null or an empty string, or holds real content. |
IS TRUE / IS FALSE | For BOOL columns. |
SELECT ROWS FROM DB "shopdb" TABLE "people"
WHERE "email" IS NOT EMPTY AND "name" IS PREFIX SIMILAR TO "al"
SET ?results
SELECT ROWS FROM DB "shopdb" TABLE "people"
WHERE "age" IS GREATER THAN 18 AND "active" IS EQUAL TO true
SET ?results
Setting values with AS
Wherever a database statement needs to supply column values — inserting a row, updating a row — it uses the same "column" AS value pattern, chained with AND, that you already use elsewhere in OcaltQL for setting object keys.
INSERT INTO DB "shopdb" TABLE "people" ROW "name" AS "Alice" AND "age" AS 30
What's next
Continue to Databases & Tables to define table schemas, or jump ahead to Columns & Rows to start working with data directly.