Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

drizzle-nextjs-postgres

БесплатноБез исполняемых скриптовНе проверен

Drizzle ORM against PostgreSQL inside a Next.js App Router app. Covers client construction (globalThis singleton across HMR, serverless pool sizing…

pproencaот pproenca★ 231 звезда на GitHub

Об этом скилле

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
  • Defining or changing a pgTable — column types, indexes, enums, constraints
  • Running drizzle-kit generate / migrate / push, or hand-editing a generated .sql file
  • Wrapping work in db.transaction(), or debugging a race, deadlock, or exhausted pool
  • Reviewing a list, count, or pagination query that is fine locally and slow in production

Rule Categories

# Category Prefix Covers
1 Client Construction & Driver Choice conn- Singletons across HMR, serverless pool sizing, poolers, driver capability, server-only, passing schema
2 Reads in Server Components rsc- Suspense boundaries, use cache / cacheLife / cacheTag, request dedupe, waterfalls, runtime choice
3 Server Actions & Mutations mut- Authorization and validation in the action, cache invalidation, deferred writes
4 Postgres Schema Definition schema- timestamptz, identity columns, text vs varchar, numeric, jsonb, bigint modes, table config, enums
5 Migrations & Schema Change Safety migrate- generate vs push, concurrent indexes, where migrations run, renames, lock-safe constraints
6 Transactions & Pooled Connections tx- Connection cost of a held transaction, row locking, serialization retries
7 Postgres Query Building query- Keyset pagination, count cost, driver-dependent execute shape, NULL semantics, prepared statements

Quick Reference

1. Client Construction & Driver Choice

2. Reads in Server Components

3. Server Actions & Mutations

Полный SKILL.md на GitHub

Установить drizzle-nextjs-postgres в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/conn-disable-prepare-behind-transaction-pooler.mdreferences/conn-driver-choice-follows-transactions.mdreferences/conn-pass-schema-for-relational-queries.mdreferences/conn-pool-sizing-for-serverless.mdreferences/conn-server-only-db-module.mdreferences/conn-singleton-across-hmr.mdreferences/migrate-add-constraints-not-valid-then-validate.mdreferences/migrate-concurrent-index-outside-transaction.mdreferences/migrate-generate-not-push.mdreferences/migrate-map-renames-explicitly.mdreferences/migrate-run-in-deploy-step-not-at-runtime.mdreferences/mut-after-for-post-response-writes.mdreferences/mut-authorize-inside-the-action.mdreferences/mut-updatetag-vs-revalidatetag.mdreferences/query-count-scans-the-table.mdreferences/query-execute-shape-is-driver-dependent.mdreferences/query-keyset-not-offset.mdreferences/query-not-in-null-trap.mdreferences/query-prepared-statements-need-names.mdreferences/rsc-dedupe-with-react-cache.mdreferences/rsc-no-request-apis-inside-use-cache.mdreferences/rsc-node-runtime-not-edge.mdreferences/rsc-suspense-around-uncached-reads.mdreferences/rsc-use-cache-is-per-instance-memory.mdreferences/rsc-use-cache-replaces-unstable-cache.mdreferences/schema-bigint-mode-truncation.mdreferences/schema-enum-values-are-append-only.mdreferences/schema-identity-not-serial.mdreferences/schema-jsonb-with-dollar-type.mdreferences/schema-numeric-is-a-string.mdreferences/schema-table-extras-are-an-array.mdreferences/schema-text-not-varchar-length.mdreferences/schema-timestamptz-not-timestamp.mdreferences/tx-lock-rows-for-read-modify-write.mdreferences/tx-no-external-io-inside.mdreferences/tx-retry-serialization-failures.md

FAQ

Что делает скилл 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.

Как установить скилл drizzle-nextjs-postgres?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл drizzle-nextjs-postgres запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить drizzle-nextjs-postgres с