Stored Procedures

OxiScript

A purpose-built scripting language for OxiDB stored procedures — full lexer, recursive-descent parser, and compiler that lower into OxiDB's JSON step format. Procedures run server-side inside one ACID boundary; abort rolls everything back.

New here? Start with the tutorial — install, hello-world, syntax, database operations, real-world recipes, and API reference. Or jump straight to Install & enable.

What you can do

  • One round-trip multi-step logic — no chatty client/server back-and-forth.
  • ACID by default — every procedure is a single OCC transaction. abort rolls back.
  • Composable — procedures can call other procedures.
  • Same query language — Mongo-style $inc/$set/$push/$gte work as-is.
  • Familiar syntax — JS/Rust-shaped: proc, let, if/else, for/in, return, abort.

The 30-second pitch

proc transfer(from, to, amount) {
    let sender = find_one("accounts", {account_id: from})
    if sender == null             { abort "sender not found" }
    if sender.balance < amount  { abort "insufficient funds" }

    update("accounts", {account_id: from}, {$inc: {balance: -amount}})
    update("accounts", {account_id: to},   {$inc: {balance:  amount}})
    insert("transactions", {from: from, to: to, amount: amount})

    return {ok: true, transferred: amount}
}

One TCP round-trip. One transaction. Validates, debits, credits, audits — atomically.

Where to go next

Report Issue