# Postgres Drizzle

> PostgreSQL with Drizzle ORM and Drizzle Kit. Use when defining schema, generating or applying SQL migrations, or querying Postgres. Prefer generate-and-review over drizzle-kit push on shared databases.

- Skill: `vostrikovva/postgres-drizzle` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vostrikovva/postgres-drizzle`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vostrikovva/postgres-drizzle/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: vostrikovva (https://skillmd.com/u/vostrikovva)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/vostrikovva/postgres-drizzle

---


# PostgreSQL + Drizzle

TypeScript schema in `pgTable` (or equivalent). Query types come from the schema, not `any`.

Schema and migration file paths below are defaults. Real directories come from the `implement`/`tdd` recon of `package.json` and `tsconfig.json` (monorepo, `paths`).

## Kit

- Change schema in TS → `drizzle-kit generate` → **read the SQL** → then `migrate`.
- Do not run `drizzle-kit push` against a shared or production database unless the user explicitly asked and understands it can skip migration history.
- Never print `DATABASE_URL` or credentials in chat.

## Migrations

Irreversible changes (drop column, drop table) need an explicit user OK. Prefer expand/contract over rewrite-in-place.

## vs Mongo

Relational data, joins, constraints → Postgres. Document-shaped, uneven records → `mongodb` skill.

