drizzle-sqlite-scaffold
БесплатноБез исполняемых скриптовНе проверенScaffolds Drizzle ORM + SQLite boilerplate — a new `drizzle.config.ts`, a singleton client with the right pragmas, per-table schema files with explicit…
от pproenca★ 231 звезда на GitHubОб этом скилле
Drizzle SQLite Scaffold
Parameterized templates for bootstrapping Drizzle + SQLite in a fresh project, or adding a new table/repository to an existing one. Every output bakes in the conventions documented in references/conventions.md — explicit primary keys, indexed foreign keys, relations() declarations, $inferSelect/$inferInsert exports, timestamp_ms dates, boolean-mode bools, WAL + foreign_keys=ON + busy_timeout pragmas, singleton client with HMR guard, and CRUD helpers using .returning() + inArray() + .onConflictDoUpdate().
When to Apply
Reach for these templates when:
- Starting a new project that will use Drizzle with SQLite (any driver)
- Adding a new table to an existing Drizzle project — the table file should match the existing patterns
- Adding a CRUD repository module for an existing table
- Refactoring a hand-rolled Drizzle setup that's missing pragmas, has no
relations(), or has hand-writtenUsertypes that drift from the schema - Migrating from another ORM (Prisma, Kysely) to Drizzle and wanting consistent shapes from the start
Setup
Required parameters (asked on first use, saved to config.json)
| Parameter | Required | Default | Values |
|---|---|---|---|
driver |
yes | — | better-sqlite3 | libsql | bun-sqlite (D1 has a different lifecycle — see "Cloudflare D1" below) |
db_url_env |
no | DATABASE_URL |
env var name |
schema_dir |
no | ./src/db/schema |
per-table schema files |
repository_dir |
no | ./src/db/repository |
per-table CRUD modules |
validators_dir |
no | ./src/db/validators |
drizzle-zod schemas (when with_zod=true) |
client_path |
no | ./src/db/client.ts |
singleton client module |
migrations_dir |
no | ./drizzle |
drizzle-kit output |
If config.json already exists with values, this skill uses them; otherwise it asks via AskUserQuestion.
Per-table parameters (asked each time a new table is scaffolded)
| Parameter | Required | Default | Description |
|---|---|---|---|
name |
yes | — | Kebab-case singular: user, order-item. Used for filenames and TS identifiers (name_camel, name_pascal derived). |
table_name |
no | snake_case plural of name |
SQL table name: users, order_items |
pk |
no | serial-int |
serial-int | uuid | cuid2 | text |
timestamps |
no | true |
adds createdAt/updatedAt columns |
soft_delete |
no | false |
adds nullable deletedAt + partial index |
relations |
no | [] |
list of related table names — expands relations() body |
with_zod |
no | true |
emits a drizzle-zod validators file |
Available Templates
Project-init templates (emit once)
| Template | Output File | When |
|---|---|---|
drizzle.config.local.ts.template |
drizzle.config.ts |
driver is better-sqlite3, bun-sqlite, or libsql with a file: URL |
drizzle.config.turso.ts.template |
drizzle.config.ts |
driver is libsql against Turso (remote libsql: URL) |
client.better-sqlite3.ts.template |
{{client_path}} |
driver is better-sqlite3 |
client.libsql.ts.template |
{{client_path}} |
driver is libsql |
client.bun-sqlite.ts.template |
{{client_path}} |
driver is bun-sqlite |
schema-index.ts.template |
{{schema_dir}}/index.ts |
Always (initially empty; append exports as tables are added) |
gitignore.template |
.gitignore (append) |
Always |
Per-table templates (emit once per table)
| Template | Output File | When |
|---|---|---|
table.ts.template |
{{schema_dir}}/{{name}}.ts |
Per table |
repository.ts.template |
{{repository_dir}}/{{name}}.ts |
Per table |
validators.ts.template |
{{validators_dir}}/{{name}}.ts |
Per table when with_zod=true |
How to Use
Flow A — Initialize a new project (run once)
Resolve project parameters. Read
config.json. For any required field that's empty, ask the user viaAskUserQuestion(driver is the only strictly required one; the rest have sensible defaults).Install runtime + tooling first so the rendered files type-check immediately:
# Pick the driver-specific runtime package: npm install drizzle-orm @libsql/client # for libsql npm install drizzle-orm better-sqlite3 # for better-sqlite3 npm install drizzle-orm # bun:sqlite is built into Bun # Dev
Установить drizzle-sqlite-scaffold в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл drizzle-sqlite-scaffold?
Scaffolds Drizzle ORM + SQLite boilerplate — a new `drizzle.config.ts`, a singleton client with the right pragmas, per-table schema files with explicit primary keys/indexed foreign keys/relations()/inferred types, per-table repository modules with `.returning()` + `inArray()` + `.onConflictDoUpdate()`, or drizzle-zod validators. Produces convention-enforced templates for three drivers (better-sqlite3, libsql/Turso, bun:sqlite). Trigger even when the user doesn't say "scaffold" — phrases like "add a table for X", "set up Drizzle in this project", "wire up SQLite", "create a CRUD module for X", or "bootstrap the DB layer" should pull this in. Pairs with the `drizzle-sqlite` skill, which covers the 45 rules these templates encode — read it when an exception is required.
Как установить скилл drizzle-sqlite-scaffold?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл drizzle-sqlite-scaffold запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set 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…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic