Individual skill
drizzle-nextjs-postgres
Drizzle ORM against PostgreSQL inside a Next.js App Router app. Covers client construction (globalThis singleton across HMR, serverless pool sizing, `prepare:false` behind PgBouncer/Supavisor, driver choice when you need interactive transactions, `server-only`), reads in Server Components under Next.js 16 Cache Components (`use cache` superseding `unstable_cache` and the `revalidate`/`dynamic` segment configs, Suspense boundaries, React `cache()` dedupe), Server Actions (authorization inside the action, `updateTag` vs `revalidateTag`, `after()`), Postgres schema types (timestamptz, identity vs serial, jsonb, numeric-as-string, bigint modes), drizzle-kit migrations (generate vs push, CONCURRENTLY outside the migrator, NOT VALID constraints, rename prompts), transactions and pooled connections, and Postgres query traps (keyset pagination, count cost, driver-dependent `db.execute()` shape, NOT IN nulls, prepared statements). Use when writing or reviewing Drizzle + Postgres code in Next.js.
skills/.experimental/drizzle-nextjs-postgres/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 5, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 221
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
- writing Derived category
- data Derived category
- engineering Derived category
- data-databases Derived category
- engineering-web Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 11,004 bytesSKILL.mdcore · 10,814 bytesSKILL.mdcore · 10,814 bytesassets/templates/_template.mddoc · 1,147 bytesmetadata.jsonasset · 3,427 bytesreferences/_sections.mddoc · 3,419 bytesreferences/conn-disable-prepare-behind-transaction-pooler.mddoc · 1,749 bytesreferences/conn-driver-choice-follows-transactions.mddoc · 2,816 bytesreferences/conn-pass-schema-for-relational-queries.mddoc · 2,244 bytesreferences/conn-pool-sizing-for-serverless.mddoc · 2,567 bytesreferences/conn-server-only-db-module.mddoc · 1,710 bytesreferences/conn-singleton-across-hmr.mddoc · 1,780 bytesreferences/migrate-add-constraints-not-valid-then-validate.mddoc · 2,182 bytesreferences/migrate-concurrent-index-outside-transaction.mddoc · 2,094 bytesreferences/migrate-generate-not-push.mddoc · 1,825 bytesreferences/migrate-map-renames-explicitly.mddoc · 2,023 bytesreferences/migrate-run-in-deploy-step-not-at-runtime.mddoc · 2,385 bytesreferences/mut-after-for-post-response-writes.mddoc · 1,885 bytesreferences/mut-authorize-inside-the-action.mddoc · 2,377 bytesreferences/mut-updatetag-vs-revalidatetag.mddoc · 1,828 bytesreferences/query-count-scans-the-table.mddoc · 2,057 bytesreferences/query-execute-shape-is-driver-dependent.mddoc · 1,891 bytesreferences/query-keyset-not-offset.mddoc · 2,051 bytesreferences/query-not-in-null-trap.mddoc · 1,790 bytesreferences/query-prepared-statements-need-names.mddoc · 1,906 bytesreferences/rsc-dedupe-with-react-cache.mddoc · 1,761 bytesreferences/rsc-no-request-apis-inside-use-cache.mddoc · 2,149 bytesreferences/rsc-node-runtime-not-edge.mddoc · 1,798 bytesreferences/rsc-suspense-around-uncached-reads.mddoc · 2,229 bytesreferences/rsc-use-cache-is-per-instance-memory.mddoc · 2,136 bytesreferences/rsc-use-cache-replaces-unstable-cache.mddoc · 1,723 bytesreferences/schema-bigint-mode-truncation.mddoc · 1,904 bytesreferences/schema-enum-values-are-append-only.mddoc · 1,907 bytesreferences/schema-identity-not-serial.mddoc · 1,711 bytesreferences/schema-jsonb-with-dollar-type.mddoc · 1,637 bytesreferences/schema-numeric-is-a-string.mddoc · 1,987 bytesreferences/schema-table-extras-are-an-array.mddoc · 2,097 bytesreferences/schema-text-not-varchar-length.mddoc · 1,654 bytesreferences/schema-timestamptz-not-timestamp.mddoc · 1,815 bytesreferences/tx-lock-rows-for-read-modify-write.mddoc · 2,030 bytesreferences/tx-no-external-io-inside.mddoc · 2,080 bytesreferences/tx-retry-serialization-failures.mddoc · 2,457 bytes
Read excerpt
# Drizzle + PostgreSQL in Next.js
Library-reference skill for Drizzle ORM on PostgreSQL inside the Next.js App Router — 36 rules across 7 categories. Each rule names the wrong default it corrects; there is no rule for things a capable model already gets right.
This skill is self-contained: it includes the migration-workflow and type-inference rules a Postgres + Next.js developer needs even where the underlying wrong default is not Postgres-specific, so you never have to load a second skill mid-task. A few of those knowingly overlap the sibling `drizzle-sqlite` skill (same wrong default, restated for this context); the rest are decisions that only exist, or only bite differently, because the dialect is PostgreSQL or the code runs in the App Router.
Pinned to **drizzle-orm 0.45.2**, **drizzle-kit 0.31.10**, **Next.js 16.2.11**, PostgreSQL 14+.
## When to Apply
- Writing or reviewing the `lib/db` module — driver choice, pooling, singletons, `server-only`
- Fetching data in a Server Component, Route Handler, or `generateMetadata` with `db.select()` / `db.query.*`
- Deciding what to cache: `use cache`, `cacheLife`, `cacheTag`, React `cache()`, or nothing
- Writing a Server Action that mutates rows and has to invalidate what the read path cached