Skip to content
/ drzl Public

Zero‑friction codegen for Drizzle ORM. Analyze your schema. Generate validation, services, and routers — fast.

License

Notifications You must be signed in to change notification settings

use-drzl/drzl

Repository files navigation

DRZL – Zero‑friction codegen for Drizzle ORM

DRZL

Zero‑friction codegen for Drizzle ORM. Analyze your schema. Generate validation, services, and routers — fast.


CI npm pnpm typescript node

Sponsor

  • GitHub Sponsors: https://github.com/sponsors/omar-dulaimi
  • Want something prioritized? Look for issues labeled sponsor-wanted (or open one) and DM @omardulaimidev so we can reserve it for you.
  • Custom template/generator/adapter requests happen via X DM. Paid work ships back into DRZL so everyone benefits.

What’s Inside

  • Analyzer: turns Drizzle schemas into a normalized analysis model
  • Generators: Zod, Valibot, ArkType validation; typed CRUD services; router templates (oRPC)
  • Batteries: formatting, naming, reusable/shared schemas, relation support
  • Monorepo: pnpm workspace, lockstep releases with Changesets

Install & Use

  • Install the CLI and init a config
pnpm add @drzl/cli -D
pnpm drzl init
  • Generate code
pnpm drzl generate -c drzl.config.ts

Minimal config

// drzl.config.ts
import { defineConfig } from '@drzl/cli/config';

export default defineConfig({
  schema: 'src/db/schemas/index.ts',
  outDir: 'src/api',
  generators: [
    { kind: 'zod', path: 'src/validators/zod' },
    { kind: 'service', path: 'src/services', dataAccess: 'drizzle' },
    { kind: 'orpc', template: '@drzl/template-orpc-service' },
  ],
});

Runtime

  • ESM / ES2021 output
  • Node ≥ 18.17 (tested on Node 20+)

Packages

  • packages/analyzer — schema analysis
  • packages/cli — CLI (drzl)
  • packages/generator-orpc — oRPC router generator
  • packages/generator-service — typed service generator
  • packages/generator-zod — Zod generator
  • packages/generator-valibot — Valibot generator
  • packages/generator-arktype — ArkType generator
  • packages/validation-core — shared validation utilities
  • packages/template-orpc-service — oRPC router template (service‑backed)
  • packages/template-standard — minimal oRPC router template

See each package’s README for details.

Development

  • Install: pnpm install
  • Build: pnpm -r run build
  • Test: pnpm -r test
  • Lint: pnpm lint

Docs

VitePress site lives in docs/ (kept out of releases). Local dev:

pnpm -C docs dev

Funded Features

  • None yet — be the first! If you need a template, generator, or adapter that doesn’t exist yet, DM me on X (https://x.com/omardulaimidev) and we can scope a sponsored build. Funded work lands in this repo under Apache‑2.0 so everyone benefits.

Contributing

Contributions welcome — see CONTRIBUTING.md.

License

Apache-2.0

About

Zero‑friction codegen for Drizzle ORM. Analyze your schema. Generate validation, services, and routers — fast.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project