Skip to main content

API Overview

Public Surface

import {
CSDBDatabase,
openCSDB,
saveCSDB,
parseCSDB,
serializeCSDB,
parseSQL,
CSDBError,
SQLError,
ValidationError
} from "@csdb/typescript";

Main Objects

  • CSDBDatabase owns a parsed CSDB document and executes queries.
  • TableQuery is returned by db.table(name) and builds fluent table operations.
  • QueryPlan is the shared internal representation used by SQL and direct execution.
  • Row is a language-native key/value object for one table record.
  • TableSchema describes columns, keys, constraints, indexes, relationships, computed fields, and comments.

Common Flow

const db = await openCSDB("payroll.csdb");
db.table("workers").insert({ id: "w_001", name: "Ada", email: "ada@example.com" });
db.validate();
await saveCSDB(db, "payroll.csdb");