Command Palette

Search for a command to run...

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

drizzle-sqlite

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

Drizzle ORM targeting SQLite (better-sqlite3, libsql/Turso, bun:sqlite, Cloudflare D1, expo-sqlite, op-sqlite). Covers schema definition (column modes…

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

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

dot-skills Drizzle SQLite Best Practices

Library-reference skill for Drizzle ORM with SQLite-family backends. 45 rules across 8 categories, ordered by execution-lifecycle impact: schema → migrations → query → relations → transactions → performance → connection → types.

When to Apply

Reference these guidelines when:

  • Defining sqliteTable schemas — choosing column types, primary keys, indexes, foreign keys
  • Running drizzle-kit generate / migrate / push, or hand-editing a migration SQL file
  • Writing queries with db.select(), db.insert(), db.update(), db.delete()
  • Reaching for nested data with db.query.* and the relational query builder
  • Wrapping multi-statement writes in db.transaction() or db.batch() (libsql/Turso/D1)
  • Optimizing a hot-path query with .prepare() + sql.placeholder() or covering indexes
  • Setting up the Drizzle client (pragmas, driver choice, singleton lifecycle)
  • Wiring database types into application code ($inferSelect, drizzle-zod, JSON shapes)

The skill is not specific to one driver — it covers behavior shared across better-sqlite3, libsql, bun:sqlite, expo-sqlite, op-sqlite, and Cloudflare D1, calling out driver-specific deviations where they exist.

Architectural Context

SQLite is unusual among production databases:

  • No client/server. The "connection" is a file open. There is no connection pool, no auth, no network in the local-file case.
  • Single writer. One writer at a time, no matter how many connections. Reads can be parallel under WAL.
  • No native booleans or dates. Everything is INTEGER, REAL, TEXT, BLOB, or NULL — Drizzle column modes encode the rest.
  • Limited ALTER TABLE. Only RENAME COLUMN, ADD COLUMN, DROP COLUMN. Type changes and constraint additions need a table rebuild.
  • Foreign keys off by default. PRAGMA foreign_keys = ON is per-connection and not persistent.

Many rules in this skill exist because Drizzle's API abstracts over PostgreSQL/MySQL/SQLite uniformly — but the underlying SQLite engine has constraints that show up at runtime if you treat it like Postgres.

Rule Categories by Priority

Priority Category Impact Prefix
1 Schema Definition CRITICAL schema-
2 Migrations & Drizzle Kit CRITICAL migrate-
3 Query Building HIGH query-
4 Relations HIGH rel-
5 Transactions & Batching MEDIUM-HIGH tx-
6 Prepared Statements & Hot Paths MEDIUM-HIGH perf-
7 Connection & Driver Setup MEDIUM conn-
8 Type Inference MEDIUM types-

Quick Reference

1. Schema Definition (CRITICAL)

2. Migrations & Drizzle Kit (CRITICAL)

3. Query Building (HIGH)

  • query-select-columns-not-star — Project to the columns you need with db.select({ ... })
  • [query-avoid-n-plus-one-with-inarray](references/query-avoid-n-plus-o
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

AGENTS.mdassets/templates/_template.mdmetadata.jsonreferences/_sections.mdreferences/conn-enable-wal.mdreferences/conn-foreign-keys-pragma.mdreferences/conn-pick-driver-deliberately.mdreferences/conn-set-busy-timeout.mdreferences/conn-singleton-client.mdreferences/migrate-apply-with-migrator.mdreferences/migrate-commit-migrations-to-git.mdreferences/migrate-config-dialect-and-out.mdreferences/migrate-data-backfill-as-custom-sql.mdreferences/migrate-explicit-renames.mdreferences/migrate-generate-not-push-in-prod.mdreferences/perf-avoid-count-star-on-large-tables.mdreferences/perf-bulk-insert-multi-row-values.mdreferences/perf-covering-index-for-hot-queries.mdreferences/perf-keyset-not-offset-for-deep-pages.mdreferences/perf-prepare-hot-paths.mdreferences/query-always-limit-listings.mdreferences/query-avoid-n-plus-one-with-inarray.mdreferences/query-bind-parameters-not-concat.mdreferences/query-returning-instead-of-reselect.mdreferences/query-select-columns-not-star.mdreferences/query-toSQL-and-explain.mdreferences/query-upsert-with-onconflict.mdreferences/rel-declare-relations-for-rqb.mdreferences/rel-filter-with-where-inside-with.mdreferences/rel-leftjoin-for-flat-aggregates.mdreferences/rel-partial-columns-in-with.mdreferences/rel-prefer-with-over-manual-joins.mdreferences/schema-always-primary-key.mdreferences/schema-foreign-keys-with-actions.mdreferences/schema-index-foreign-keys-and-lookups.mdreferences/schema-integer-for-booleans.mdreferences/schema-text-json-not-blob-json.mdreferences/schema-timestamp-mode-for-dates.mdreferences/schema-unique-constraints-for-natural-keys.mdreferences/tx-batch-for-libsql-roundtrips.md

FAQ

Что делает скилл drizzle-sqlite?

Drizzle ORM targeting SQLite (better-sqlite3, libsql/Turso, bun:sqlite, Cloudflare D1, expo-sqlite, op-sqlite). Covers schema definition (column modes, primary keys, foreign keys, indexes), drizzle-kit migrations (generate vs push, renames, custom SQL), the query builder (selects, upserts, returning, EXPLAIN), the relational query builder (relations(), `with`, partial columns), transactions and `db.batch()`, prepared statements with `sql.placeholder()`, connection pragmas (WAL, foreign_keys, busy_timeout), and Drizzle type inference (`$inferSelect`, `$inferInsert`, `$type<>`, drizzle-zod). Use when writing, reviewing, or refactoring Drizzle code for SQLite. Trigger even if the user doesn't say "performance" — schema/migration choices made now are expensive to reverse later, and SQLite-specific traps (single-writer model, no native booleans/dates, ALTER TABLE limits, FK pragma off by default) catch teams who reach for Drizzle without reading the SQLite docs.

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

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

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

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

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

Сравнить drizzle-sqlite с