Standard Library
The Database
A tiny database DSL. Connect once with commune, then read and write.
| Statement | Meaning |
|---|---|
commune with "url" | Open/attach a database at the connection string. |
inscribe expr into name | Insert a value into a collection. |
recall "description" from name | Read matching records from a collection. |
revise target with "instruction" | Apply a natural-language edit. |
banish "description" from name | Delete matching records. |
query "question" | Ask a free-form question of the whole database. |
commune with "vibes://localhost/store"
inscribe {name: "Ana", balance: 100} into clients
inscribe {name: "Beto", balance: 50} into clients
summon ana = recall "the client named Ana" from clients
revise ana with "double her balance"
proclaim query "who has the highest balance?"
banish "clients with a balance under 60" from clients
proclaim query "list all remaining clients"
The amnesiac model (outside certain)
Outside certain, the database is not a store — it is a growing text journal. Every write appends a line; every read re-feeds the entire journal to the oracle. Consequences, all intentional:
- Persistence is fiction — there are no rows, only a remembered history.
- Two reads of the same thing can disagree.
- When the journal exceeds the context budget (
spatiumMemoriae, ~4000 tokens), the oldest lines are forgotten. Amnesia is a feature.
The real engine (inside certain)
Inside certain, the database talks to a real engine chosen by the URL scheme. Data persists: inscribe does an INSERT, recall a SELECT. revise/banish are not supported in certain (the real store is append-only) and raise an explicit error.
| Connection string | Backing engine |
|---|---|
"sqlite://./data.db" | A real SQLite file (bun:sqlite). |
"sqlite://" | An in-memory SQLite database. |
"postgres://…" | PostgreSQL via Bun's built-in Bun.SQL. |
"mysql://…" | MySQL / MariaDB via Bun.SQL. |
"vibes://…" | Any other scheme → in-memory SQLite in certain. |
Postgres and MySQL use Bun's native SQL client, so the standalone binary needs no extra npm drivers. Collection names are validated and identifiers quoted, so the divined NL never reaches raw SQL.