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

Chaining — AFTER, AND, OR

Three connectors link every OQL statement. AFTER is sequential. AND is true parallel execution on the thread pool. OR is fallback — it only runs if the preceding step failed or returned null. No callbacks, no promises, no async/await.

OperatorMeaningAnalogy
AFTERSequential — next step runs when this one completesawait
ANDParallel — branches execute simultaneouslyPromise.all
ORFallback — executes only if the preceding step failed or returned nullcatch / else

AFTER — sequential pipeline

Each AFTER step has full access to everything set by previous steps.

UPPER "hello world" SET ?u AFTER REPLACE ?u WHERE "WORLD" WITH "OQL" SET ?r AFTER LENGTH ?r SET ?len AFTER EMIT ?r & " (" & ?len & " chars)"
Try it ›
FETCH "https://httpbin.org/uuid" SET ?resp AFTER EMIT ?resp(uuid)
Try it ›

AND — parallel execution

AND branches execute simultaneously on the runtime thread pool. Each branch must use a separate variable name for independent values.

HASH "secret1" USING "SHA256" SET ?a AND HASH "secret2" USING "SHA256" SET ?b AND HASH "secret3" USING "SHA256" SET ?c AFTER EMIT ?a & " | " & ?b & " | " & ?c
Try it ›

Multivariables — AND with shared name

When AND branches bind to the same variable name, OQL creates a multivariable — a parallel structure holding one result per branch. Use COLLAPSE to merge into an array.

UPPER "alpha" SET ?r AND UPPER "beta" SET ?r AND UPPER "gamma" SET ?r (* ?r is now a multivariable with 3 branches *) COLLAPSE ?r SET ?all AFTER EMIT ?all
Try it ›

OR — fallback chain

OR runs only if the preceding step returned an error or null. Use it for retry logic, default values, and error routing.

FETCH "https://primary-api.example.com/data" SET ?data OR FETCH "https://backup-api.example.com/data" SET ?data AFTER EMIT ?data
CACHE "config" SET ?cfg OR QUERY "config" FROM "app" LIMIT 1 SET ?cfg AFTER EMIT ?cfg

Mixing operators

A single query can use all three. Parallel branches resolve before the next AFTER step executes.

FETCH "https://httpbin.org/uuid" SET ?a AND FETCH "https://httpbin.org/uuid" SET ?b AFTER EMIT "Got: " & ?a(uuid) & " and " & ?b(uuid) AFTER EMIT "Done"
Try it ›