Skip to main content

DB-X

Production-grade database schema deployment, with a Time Machine and AI review.

Drizzle and Prisma own the application side. DB-X owns the operations side — preview, apply, snapshot, restore, and let an AI agent review your schema change before it ships.

The schema is the source of truth

A DB-X schema is a JSX component. Apply it to a managed Postgres via <DatabaseTarget>, or stand up a fresh container in a single Compose stack via <Service> — the same schema, two distributions.

schema.tsx
/** @jsxImportSource @db-x/runtime */
import { Column, Postgres, Table } from '@db-x/postgres-library';

// The single source of truth. Both runtimes below apply this exact tree.
export const schema = (
<Postgres name="todos-db">
<Table name="todos">
<Column name="id" type="serial" primaryKey />
<Column name="title" type="text" notNull />
<Column name="done" type="boolean" notNull default="false" />
</Table>
</Postgres>
);

Time Machine

Snapshot before every apply. Restore in one command. Diff any two points in time. Pg_dump for self-hosted, RDS / Cloud SQL APIs for managed.

Shadow-DB preview

Spin an ephemeral copy, dry-run the DDL, report timings and lock contention before the real apply. Find the bad migration on staging, not at 2am.

AI review built in

An MCP server exposes describe, explain, graph, and preview as tools. Claude Code / Cursor / Cline can review the change against the live schema before you ship.

Stays out of your ORM

DB-X owns deployment, not your query layer. Keep Drizzle, Prisma, sqlc, or whatever — DB-X exports types so the two stay in sync.