| Ocalt Query Language
Pricing Dashboard ocalt.com v1.0

Database

Each namespace has its own isolated database system. No server configuration, no connection strings, no credentials. Create databases and tables on the fly — OQL manages all storage internally.

VerbDescription
CREATE DATABASE "name"Create a new database
DATABASE LIST SET ?dbsList all databases in the namespace
CREATE TABLE "tbl" FROM "db" WITH "schema"Create a table with column definitions
TABLE LIST "db" SET ?tablesList all tables in a database
INSERT ?obj INTO "table" FROM "db" SET ?idInsert one row — returns new row ID
QUERY "table" FROM "db" SET ?rowsSelect all rows
QUERY "table" FROM "db" WHERE condition SORT BY "col" LIMIT n SET ?rowsSelect with filter, sort, and limit
UPDATE ?obj INTO "table" FROM "db" WHERE conditionUpdate matching rows
PURGE "table" FROM "db" WHERE conditionDelete matching rows
FLUSH TABLE "tbl" FROM "db"Delete all rows, keep the table
DELETE TABLE "tbl" FROM "db"Drop a table entirely
DELETE DATABASE "db"Drop a database and all its tables

CREATE DATABASE

CREATE DATABASE "shop" AFTER EMIT "Database created"
Try it ›

CREATE TABLE

Column types: TEXT NUMBER BOOLEAN DATE TIMESTAMP UUID ENCRYPTED BLOB. Modifiers: PRIMARY UNIQUE REQUIRED.

CREATE TABLE "products" FROM "shop" WITH " id UUID PRIMARY, name TEXT UNIQUE REQUIRED, price NUMBER REQUIRED, in_stock BOOLEAN, created_at TIMESTAMP " AFTER EMIT "Table created"
Try it ›

INSERT

NEW JSON OBJECT OPEN NEST SET "name" AS "Widget Pro" AND SET "price" AS 29.99 AND SET "in_stock" AS true CLOSE NEST SET ?product AFTER INSERT ?product INTO "products" FROM "shop" SET ?id AFTER EMIT "Inserted ID: " & ?id
Try it ›

QUERY

Without a WHERE clause, returns all rows. Column names in conditions are bare identifiers — quote them if needed but they do not need to be quoted.

QUERY "products" FROM "shop" SET ?rows AFTER EMIT ?rows
Try it ›
(* Filter, sort, limit *) QUERY "products" FROM "shop" WHERE in_stock IS EQUAL TO true SORT BY "price" LIMIT 10 SET ?rows AFTER EMIT ?rows
Try it ›
(* Text search *) QUERY "products" FROM "shop" WHERE name CONTAINS "Widget" SET ?rows AFTER EMIT ?rows
(* Using a variable in WHERE *) QUERY "users" FROM "app" WHERE email IS IDENTICAL TO ?email LIMIT 1 SET ?user AFTER EMIT ?user

WHERE condition operators

OperatorUsage
IS EQUAL TOWHERE status IS EQUAL TO "active"
IS IDENTICAL TOWHERE id IS IDENTICAL TO ?user_id
IS NOT EQUAL TOWHERE role IS NOT EQUAL TO "guest"
IS GREATER THANWHERE price IS GREATER THAN 50
IS LESS THANWHERE age IS LESS THAN 18
IS GREATER THAN OR EQUAL TOWHERE score IS GREATER THAN OR EQUAL TO 90
IS LESS THAN OR EQUAL TOWHERE stock IS LESS THAN OR EQUAL TO 0
IS NULLWHERE deleted_at IS NULL
IS NOT NULLWHERE verified_at IS NOT NULL
CONTAINSWHERE name CONTAINS "widget"

UPDATE

NEW JSON OBJECT OPEN NEST SET "price" AS 34.99 CLOSE NEST SET ?changes AFTER UPDATE ?changes INTO "products" FROM "shop" WHERE id IS IDENTICAL TO ?product_id

PURGE

PURGE "sessions" FROM "app" WHERE expires IS LESS THAN !NOW AFTER EMIT "Expired sessions cleaned"

DATABASE LIST / TABLE LIST

DATABASE LIST SET ?dbs AFTER EMIT ?dbs TABLE LIST "shop" SET ?tables AFTER EMIT ?tables
Try it ›

FLUSH TABLE

Deletes all rows in the table. The table schema is preserved.

FLUSH TABLE "sessions" FROM "app" AFTER EMIT "All sessions cleared"

DELETE TABLE / DELETE DATABASE

DELETE TABLE drops the table and all its rows. DELETE DATABASE drops the entire database including all its tables.

DELETE TABLE "temp_imports" FROM "shop" AFTER EMIT "Table dropped"
DELETE DATABASE "old_archive" AFTER EMIT "Database dropped"

INSERT ROW — alias for INSERT

INSERT ROW is identical to INSERT. Both forms are accepted.

NEW JSON OBJECT OPEN NEST SET "name" AS "Alice" AND SET "role" AS "admin" CLOSE NEST SET ?user AFTER INSERT ROW ?user INTO "users" FROM "app" SET ?id AFTER EMIT ?id