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.

vostrikovva Updated

File contents

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 generateread 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.

vostrikovva/cursor-skills/tree/main/skills/stack/postgres-drizzle commit c4d1c6611b

Frequently asked questions

npx skillmds@latest add vostrikovva/postgres-drizzle