Drizzle
Build type-safe database queries with Drizzle ORM patterns.
от clawic★ 23 звезды на GitHub
Установить Drizzle в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Schema Definition
- Export every table from schema file — queries fail silently if table isn't exported
- Use
$inferSelectfor query return types,$inferInsertfor insert input — they differ (select has defaults filled, insert has optionals) - Define
relations()in a separate call, not inline with table — Drizzle separates schema from relations
Query Syntax Traps
- Conditions use functions, not objects:
where: eq(users.id, 5)notwhere: { id: 5 }— Prisma syntax doesn't work - Combine conditions with
and()/or():where: and(eq(users.active, true), gt(users.age, 18)) db.query.users.findMany()for relational queries withwith:,db.select().from(users)for SQL-like — mixing them causes type errors
Migrations
drizzle-kit pushis dev-only (destructive) — production needsdrizzle-kit generatethendrizzle-kit migrate- Schema changes require regenerating migrations — editing generated SQL breaks the migration hash
- Set
strict: truein drizzle.config.ts to catch schema drift before it hits production
Driver-Specific
- PostgreSQL: use
pgTable, imports fromdrizzle-orm/pg-core - MySQL: use
mysqlTable, imports fromdrizzle-orm/mysql-core - SQLite: use
sqliteTable, imports fromdrizzle-orm/sqlite-core - Mixing imports across drivers compiles but fails at runtime with cryptic errors
Performance
- Wrap multi-query operations in
db.transaction(async (tx) => {})— Drizzle doesn't auto-batch - Use
.prepare()for queries executed repeatedly — skips query building overhead - Add
.limit()to everyfindMany()/select()— no default limit means full table scans
Common Mistakes
- Forgetting
awaiton queries returns a Promise, not results — TypeScript doesn't catch this if you ignore the return returning()is required to get inserted/updated rows back — without it you get{ rowCount }only- JSON columns: PostgreSQL uses
jsonb(), MySQL usesjson()— wrong function = wrong serialization
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _meta.json
FAQ
Что делает скилл Drizzle?
Build type-safe database queries with Drizzle ORM patterns.
Как установить скилл Drizzle?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Drizzle запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…