ccheney avatar

Postgres Drizzle

This gets you type-safe PostgreSQL with Drizzle ORM without the usual pitfalls. It covers schema design, relational queries, and migrations with drizzle-kit, plus specific fixes for common performance problems like N+1 queries and missing indexes on foreign keys. The decision trees are genuinely helpful when you're staring at a slow query or trying to figure out which drizzle-kit command to run. It assumes PostgreSQL 18 and pushes you toward connection pooling and the relational query API instead of raw SQL everywhere. Good if you want guardrails around database code that actually prevent the mistakes that show up in production.

skills.sh installs
1.5K
GitHub stars
62
last updated
Aug 21, 2026

Install

$ npx -y skills add ccheney/robust-skills --skill postgres-drizzle --agent claude-code

Installs into .claude/skills of the current project.

Files

PostgreSQL and Drizzle ORM

Match database work to the project's installed API and deployment context. The user's explicit instructions take precedence over this skill's guidelines.

Establish the database contract

Use the relevant schema/query, migration history, and requested behavior as input. For Drizzle code, inspect installed drizzle-orm/drizzle-kit versions and the driver; for SQL, establish the PostgreSQL version when a version-specific feature matters.

The references cover PostgreSQL 17/18 and distinguish Drizzle's 0.x relations() API from the v1 defineRelations() API. Do not mix them or infer the installed API from an npm dist-tag. When the version is unknown, use imports/lockfiles or ask for the missing version before giving version-dependent code.

Keep changes consistent

Sponsors

Details

Repository
github.com/ccheney/robust-skills
Categories
Backend & APIs, Documentation, Databases
First seen
Apr 16, 2026

More from ccheney/robust-skills

All 5
1aj-geddes avatarflask-api-developmentaj-geddes/useful-ai-promptsDevelop lightweight Flask APIs with routing, blueprints, database integration, authentication, and request/response handling. Use when building RESTful APIs, mi1.4Kskills.sh installs
2langfuse avatarbackend-dev-guidelineslangfuse/langfuseBuild or review Langfuse backend code. Use for tRPC routers, public REST APIs, BullMQ processors, services, middleware, Prisma or ClickHouse access, OpenTelemet1.4Kskills.sh installs
3bobmatnyc avatardrizzle-migrationsbobmatnyc/claude-mpm-skillsMigration-first database development workflow using Drizzle ORM for TypeScript/J...1.3Kskills.sh installs
4vtex avatarvtex-io-auth-tokens-and-contextvtex/skillsApply when choosing which VTEX IO authentication token should back a request from a backend app. Covers `ctx.authToken`, `ctx.storeUserAuthToken`, `ctx.adminUse1.2Kskills.sh installs
5vtex avatarheadless-checkout-proxyvtex/skillsApply when implementing cart, checkout, or order placement logic proxied through a BFF for headless VTEX storefronts. Covers OrderForm lifecycle, cart creation,1.1Kskills.sh installs
6alchemyplatform avataragentic-gatewayalchemyplatform/skillsWire Alchemy into application code without an API key, using the x402 or MPP gateway with wallet-based auth (SIWE/SIWS) and per-request payments (USDC via x402,1.1Kskills.sh installs