Drizzle Orm
growupanand/ConvoForm
Type-safe SQL ORM for TypeScript with zero runtime overhead. An agent skill from growupanand/ConvoForm.
| Type-safe ORM for Cloudflare D1 databases using Drizzle. An agent skill from secondsky/claude-skills.
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install secondsky/claude-skills drizzle-orm-d1 --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .claude/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .claude/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install secondsky/claude-skills drizzle-orm-d1 --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .agents/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .agents/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install secondsky/claude-skills drizzle-orm-d1 --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .cursor/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .cursor/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/secondsky/claude-skills.git --path plugins/drizzle-orm-d1/skills/drizzle-orm-d1--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install secondsky/claude-skills drizzle-orm-d1 --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .gemini/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .gemini/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install secondsky/claude-skills drizzle-orm-d1Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .github/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .github/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install secondsky/claude-skills drizzle-orm-d1 --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 .opencode/skills/drizzle-orm-d1 && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "drizzle-orm-d1" agent skill from https://github.com/secondsky/claude-skills/tree/main/plugins/drizzle-orm-d1/skills/drizzle-orm-d1 into .opencode/skills/drizzle-orm-d1/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "drizzle-orm-d1", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
drizzle-orm-d1| Type-safe ORM for Cloudflare D1 databases using Drizzle. An agent skill from secondsky/claude-skills.
Drizzle Orm D1 is an agent skill from secondsky/claude-skills. | Type-safe ORM for Cloudflare D1 databases using Drizzle. Use when: building D1 database schemas, writing type-safe SQL queries, managing migrations with Drizzle Kit, defining table relations, implementing prepared statements, using D1 batch API, or encountering D1ERROR, transaction errors, foreign key constraint failures, or schema inference issues.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 23 other files, including scripts and reference files (for example `references/common-errors.md`, `references/error-catalog.md` and `references/links-to-official-docs.md`).
It sits in Databases, covering ORMs and data access, Type safety and SQL. It works with Drizzle ORM, Cloudflare, SQL and Cloudflare Workers. The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (TypeScript and Shell, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
npmbunxbunwranglerFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
orm.drizzle.teamgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
CLOUDFLARE_D1_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Drizzle Orm D1 loads about 2.4k tokens when it runs, and up to ~9.4k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 566 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 566 words, ~2,357 tokens.
.claude/skills/drizzle-orm-d1/SKILL.md (or your agent's skills folder). This skill also uses 19 other files; get the full folder from GitHub.Status: Production Ready ✅ Last Updated: 2025-12-14 Latest Version: drizzle-orm@0.45.2, drizzle-kit@0.31.10 Dependencies: cloudflare-d1, cloudflare-worker-base
bun add drizzle-orm drizzle-kitCreate drizzle.config.ts:
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
schema: './src/db/schema.ts',
out: './migrations',
dialect: 'sqlite', // MANDATORY since drizzle-kit 0.21 (D1 = sqlite)
driver: 'd1-http', // D1 HTTP driver for remote migrations/Studio
dbCredentials: { // MANDATORY: drizzle-kit 0.30+ tightened zod validation
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
databaseId: process.env.CLOUDFLARE_DATABASE_ID!,
token: process.env.CLOUDFLARE_D1_TOKEN!,
},
});drizzle-kit 0.30/0.31 note:
dialectanddbCredentialsare now strictly validated. A config that omitsdialector uses the oldconnectionString/urikeys will fail validation. For D1 usedialect: 'sqlite'+driver: 'd1-http'withaccountId/databaseId/token(or wrangler-based credentials). The runtimemigrate()signature indrizzle-orm/<driver>/migratoris unchanged from 0.36 → 0.45 (it changes only in 1.0-beta, which is out of scope for^0.45).
Create src/db/schema.ts:
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
import { relations } from 'drizzle-orm';
export const users = sqliteTable('users', {
id: integer('id').primaryKey({ autoIncrement: true }),
email: text('email').notNull().unique(),
name: text('name').notNull(),
createdAt: integer('created_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
});
export const posts = sqliteTable('posts', {
id: integer('id').primaryKey({ autoIncrement: true }),
title: text('title').notNull(),
content: text('content').notNull(),
authorId: integer('author_id')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
});
export const usersRelations = relations(users, ({ many }) => ({
posts: many(posts),
}));bunx drizzle-kit generate # Generate SQL
bunx wrangler d1 migrations apply my-database --local # Apply local
bunx wrangler d1 migrations apply my-database --remote # Apply prodimport { drizzle } from 'drizzle-orm/d1';
import { users } from './db/schema';
import { eq } from 'drizzle-orm';
export default {
async fetch(request: Request, env: { DB: D1Database }): Promise<Response> {
const db = drizzle(env.DB);
const allUsers = await db.select().from(users).all();
return Response.json(allUsers);
},
};| Rule | Why |
|---|---|
Use drizzle-kit generate for migrations | Never write SQL manually |
| Test migrations locally first | --local before --remote |
Use .get() for single results | Returns first row or undefined |
Use db.batch() for transactions | D1 doesn't support SQL BEGIN/COMMIT |
Use integer with mode: 'timestamp' for dates | D1 has no native date type |
Use .$defaultFn() for dynamic defaults | Not .default() for functions |
| Rule | Why |
|---|---|
Use SQL BEGIN TRANSACTION | D1 requires batch API (Error #1) |
Mix drizzle-kit migrate and wrangler apply | Use Wrangler only |
Use drizzle-kit push for production | Use generate + apply |
| Commit credentials in drizzle.config.ts | Use env vars |
Use .default() for function calls | Use .$defaultFn() instead |
| # | Error | Solution |
|---|---|---|
| 1 | D1_ERROR: Cannot use BEGIN TRANSACTION | Use db.batch([...]) instead of db.transaction() |
| 2 | FOREIGN KEY constraint failed | Define cascading: .references(() => users.id, { onDelete: 'cascade' }) |
| 3 | env.DB is undefined | Ensure binding in wrangler.jsonc matches env.DB |
| 4 | No such module "wrangler" | Use import { drizzle } from 'drizzle-orm/d1' |
| 5 | Type instantiation excessively deep | Use InferSelectModel<typeof users> for explicit types |
See: references/error-catalog.md for all 12 errors with complete solutions.
| Pattern | Use Case | Template |
|---|---|---|
| CRUD Operations | Basic database operations | templates/basic-queries.ts |
| Relations & Joins | Nested queries, manual joins | templates/relations-queries.ts |
| Batch Operations | Transactions (D1 batch API) | templates/transactions.ts |
| Schema Design | Naming, indexes, soft deletes | references/schema-patterns.md |
| File | Purpose | Template |
|---|---|---|
drizzle.config.ts | Drizzle Kit configuration | templates/drizzle.config.ts |
wrangler.jsonc | D1 binding setup | references/wrangler-setup.md |
package.json | npm scripts for migrations | templates/package.json |
npm scripts:
{
"db:generate": "drizzle-kit generate",
"db:migrate:local": "wrangler d1 migrations apply my-database --local",
"db:migrate:remote": "wrangler d1 migrations apply my-database --remote"
}| Step | Command | Notes |
|---|---|---|
| 1. Edit schema | Edit src/db/schema.ts | Make changes |
| 2. Generate | npm run db:generate | Creates SQL migration |
| 3. Test local | npm run db:migrate:local | Verify locally |
| 4. Deploy code | npm run deploy | Push to Cloudflare |
| 5. Apply prod | npm run db:migrate:remote | Apply migration |
See: references/migration-workflow.md for complete workflow.
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
import { users } from './db/schema';
export type User = InferSelectModel<typeof users>;
export type NewUser = InferInsertModel<typeof users>;| Reference | Load When... |
|---|---|
references/error-catalog.md | Debugging D1 errors, transaction failures, binding issues |
references/schema-patterns.md | Designing schemas, naming conventions, indexes, soft deletes |
references/migration-workflow.md | Setting up or troubleshooting migrations |
references/query-builder-api.md | Complex queries, operators, joins syntax |
references/wrangler-setup.md | Configuring wrangler.jsonc for D1 |
references/common-errors.md | Quick error lookup |
Templates: basic-schema.ts, basic-queries.ts, transactions.ts, relations-queries.ts, prepared-statements.ts, drizzle.config.ts, package.json
References: error-catalog.md, schema-patterns.md, migration-workflow.md, query-builder-api.md, wrangler-setup.md, common-errors.md, links-to-official-docs.md
{
"dependencies": {
"drizzle-orm": "^0.45.2"
},
"devDependencies": {
"drizzle-kit": "^0.31.10"
}
}When installing Drizzle ORM and D1 driver packages, follow supply chain security best practices:
npm config set ignore-scripts true (or Bun: disabled by default)socket package score npm <pkg> or use socket npm install <pkg> to check packagesLoad the dependency-upgrade skill for full security configuration including Socket CLI integration, cooldown setup, lockfile validation, and CI enforcement.
Token Savings: ~65% (comprehensive patterns in references) Error Prevention: 100% (all 12 documented issues) Ready for production! ✅
© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 19 other files (scripts, references) in plugins/drizzle-orm-d1/skills/drizzle-orm-d1 of secondsky/claude-skills.
Open the folder on GitHubat commit 8837836
Drizzle Orm D1 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Drizzle Orm D1 this skillsecondsky/claude-skills | 227 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Drizzle Ormgrowupanand/ConvoForm | 101 | 1 repos | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| Drizzle Orm Expertdavila7/claude-code-templates | 32k | 3 repos | ~2.6k | Automated safety check: Pass | MIT | |
| Cloudflare D1alinaqi/maggy | 707 | — | ~4.1k | Automated safety check: Pass | MIT | |
| Database FundamentalsDanielPodolsky/ownyourcode | 290 | 1 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Basincloudflare/skills | 3k | 1 repos | ~684 | Automated safety check: Pass | Apache-2.0 |
growupanand/ConvoForm
Type-safe SQL ORM for TypeScript with zero runtime overhead. An agent skill from growupanand/ConvoForm.
davila7/claude-code-templates
Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration.
alinaqi/maggy
Cloudflare D1 SQLite database with Workers, Drizzle ORM, migrations
DanielPodolsky/ownyourcode
Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.
cloudflare/skills
Build and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL.
kurealnum/dotfiles
A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…
secondsky/claude-skills
TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.
secondsky/claude-skills
AutoAnimate (@formkit/auto-animate) zero-config animations for React.
secondsky/claude-skills
MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.
secondsky/claude-skills
This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…
secondsky/claude-skills
Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).
secondsky/claude-skills
Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.
Categories
| Type-safe ORM for Cloudflare D1 databases using Drizzle. An agent skill from secondsky/claude-skills. Drizzle Orm D1 is an agent skill from secondsky/claude-skills. | Type-safe ORM for Cloudflare D1 databases using Drizzle.
Drizzle Orm D1 fits situations like: : building D1 database schemas; writing type-safe SQL queries; managing migrations with Drizzle Kit; defining table relations.
Run `npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a claude-code`. Or copy the skill folder (plugins/drizzle-orm-d1/skills/drizzle-orm-d1 in secondsky/claude-skills) into .claude/skills/drizzle-orm-d1 in your project. Claude Code loads it when a task matches its description.
Run `npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a codex`. Or copy the skill folder (plugins/drizzle-orm-d1/skills/drizzle-orm-d1 in secondsky/claude-skills) into .agents/skills/drizzle-orm-d1 in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill drizzle-orm-d1 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/drizzle-orm-d1, .gemini/skills/drizzle-orm-d1, .github/skills/drizzle-orm-d1 and .opencode/skills/drizzle-orm-d1 in your project.
Going by SKILL.md and its folder, Drizzle Orm D1 needs TypeScript and a shell for the scripts in its folder, the command-line tools its instructions call (npm, bunx, bun and wrangler) and credentials named CLOUDFLARE_D1_TOKEN. Our summary lists: Node.js; A Bash shell; A credential in CLOUDFLARE_D1_TOKEN.
SKILL.md names 2 domains. As links in the text: orm.drizzle.team and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Drizzle Orm D1 is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Drizzle Orm D1: Drizzle Orm (growupanand/ConvoForm, 101 stars), Drizzle Orm Expert (davila7/claude-code-templates, 32k stars), Cloudflare D1 (alinaqi/maggy, 707 stars) and Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.
Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.