PRO

Drizzle Postgres JIT Query Layer

A Postgres schema and typed query layer on the Drizzle 1.0 release candidate. It uses the rc.1 casing API (snakeCase.table replaces the removed drizzle({ casing }) option), a defineRelations graph with a filtered relation and a non-optional one-to-one, opt-in JIT row mappers, module-scope prepared statements bound with sql.placeholder, rc.4 nullability-preserving sql aggregates via .mapWith() and .nullable(), and an insert().select() backfill that skips defaulted columns.

Install
npx shadcn@latest add https://ui.aryank.space/r/drizzle-pg-jit-query-layer.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
prepared
PgRelationalQuery<Package>
query
unknown
const q = db.query.packages.findFirst({ where: { slug: sql.placeholder("slug") } }).prepare("package_detail")

Prepared statements bound at module scope with sql.placeholder skip re-planning; opt-in JIT mappers shape rows on the way out.

Files

Dependencies