Schemic lets you define your database schema once in TypeScript — with the Zod API you already know — and turns that single definition into your database's native DDL, end-to-end types, and reviewable migrations.
The engine and CLI are dialect-neutral; each database is an installable driver, so the same schema targets any of them. One source of truth — no separate ORM model, no code generation, no drift.
@schemic/surrealdb— SurrealDB · available@schemic/postgres— PostgreSQL · in progress
More drivers are planned. The authoring API and the CLI are the same across every driver — only the generated DDL differs.
| Package | What it is |
|---|---|
@schemic/core |
The dialect-neutral engine: the Driver contract, the portable schema IR, and the migration / diff / snapshot engine. Zero dialect code. |
@schemic/cli |
The schemic / sc binary — also dialect-neutral; loads your driver from config.driver. |
@schemic/<driver> |
A database driver: connection, authoring, and the dialect's DDL. See Drivers for the available ones. |
Author your schema, then drive it from the dialect-neutral CLI (sc is the
short alias):
sc init # scaffold a project: schemic.config.ts + schema + .env.example
sc diff # preview changes vs the last snapshot (--ts for a TypeScript view)
sc gen # write a migration for the pending change
sc migrate # apply pending migrations
sc status # show applied vs pending migrations
sc pull # introspect a live database back into TypeScriptThe authoring API and the DDL it generates are driver-specific — see your driver's README for the exact builders and output.
Alpha (0.x). APIs may still change.
- SurrealDB driver — the most complete · coverage
- PostgreSQL driver — in progress · coverage
- more drivers
A Bun workspaces monorepo (packages/*).
bun install
bun --filter '@schemic/*' test # run every package's tests
bun --filter '@schemic/*' typecheckMIT © Vertio Solutions