Skip to content

Sandbox / runnable examples

Try forge-orm without installing anything — every example is one click away on StackBlitz:

Browser-runnableOne-liner
SQLite browser todoOPFS-persisted todo app, no server
Offline-first with sync outboxOptimistic writes + drain loop
Node CLI (smallest)Smallest possible forge-orm program
Hono + PGlite REST APIBackend API, zero external DB
Next.js + PGlite full-stackApp Router + Server Actions
IndexedDB zero-installFull CRUD + geo + vector + FTS, no wasm
Auto-runs on CodeSandboxWhy
DuckDB analytics@duckdb/node-api is a native addon
Bun + SQLite blogBun's SQLite is native
Feature deep-divesPattern
Geo searchgeoPoint + nearTo (PostGIS / Mongo / wasm fallback)
Vector RAGf.vector(N) + cosine similarity
Recipe / BOMRecursive sub-recipe rollup
Multi-tenant scopingSoft RLS via app-layer wrapper
Audit logdb.$on("query", …) filtering mutating ops
Full-text search.search() index across dialects
TransactionsAtomic batch + nested savepoints
Migrations + driftdb.$migrate() + db.$diff()
Real DB (point at your own)Setup
MongoDB Atlas blogFree Atlas tier, paste URI into .env
MSSQL ERP / MERGEDocker SQL Server, .env
Postgres + RLS authHard multi-tenant via current_setting

All 18 examples live at examples/. Clone any folder:

sh
npx degit johnsonfash/forge-orm/examples/01-sqlite-browser-todo my-app

MIT licensed. Built from the repository's own markdown — README.md, CHANGELOG.md and docs/.