drizzle-orm-d1

drizzle-orm-d1 is a skill for Claude Code from secondsky/claude-skills. It costs 76 tokens per session (2,445 once invoked), scanned A, original, MIT.

A guide for using Drizzle, a TypeScript database toolkit, with Cloudflare D1, a managed SQLite database. It covers typed queries, table definitions, relationships, prepared statements, batches, and migrations.

In plain words
What is it for?
Use it to configure Drizzle Kit, create D1 schemas, write queries, manage migrations, define relationships, use batches, and troubleshoot D1 errors.
Why use it?
It helps keep TypeScript code aligned with the database schema and addresses common D1 configuration and constraint errors. Migrations record database-structure changes so they can be applied consistently.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the drizzle-orm-d1 plugin — 1 skill shipped together

Good fit Use it to configure Drizzle Kit, create D1 schemas, write queries, manage migrations, define relationships, use batches, and troubleshoot D1 errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/drizzle-orm-d1
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add secondsky/claude-skills --skill drizzle-orm-d1
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install drizzle-orm-d1, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drizzle-orm-d1

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/drizzle-orm-d1/github.svg)](https://agentmods.dev/skills/secondsky/claude-skills/drizzle-orm-d1)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/drizzle-orm-d1"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/drizzle-orm-d1/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for drizzle-orm-d1

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/drizzle-orm-d1"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/drizzle-orm-d1.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,445 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.02445
Opus 5.5 $0.00030 $0.00978
Sonnet 5.5 $0.00015 $0.00489
Haiku 4.5 $0.00008 $0.00245

Measured 8d ago against content hash 28ee02bf0f09, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

drizzle-orm-d1 scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 10 executable files (scripts/check-versions.sh, templates/basic-queries.ts, templates/basic-schema.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request, env: { DB: D1Database }): Promise<Response> {
plugins/drizzle-orm-d1/skills/drizzle-orm-d1/SKILL.md · 295 lines

How it starts

The opening of the file, as written. The whole thing — 295 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Drizzle ORM for Cloudflare D1

Status: Production Ready ✅ Last Updated: 2025-12-14 Latest Version: [email protected], [email protected] Dependencies: cloudflare-d1, cloudflare-worker-base


Quick Start (10 Minutes)

1. Install Drizzle

bun add drizzle-orm drizzle-kit

2. Configure Drizzle Kit

Create 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: dialect and dbCredentials are now strictly validated. A config that omits dialect or uses the old connectionString/ uri keys will fail validation. For D1 use dialect: 'sqlite' + driver: 'd1-http' with accountId/databaseId/token (or wrangler-based credentials). The runtime migrate() signature in drizzle-orm/<driver>/migrator is unchanged from 0.36 → 0.45 (it changes only in 1.0-beta, which is out of scope for ^0.45).

3. Define Schema

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),
}));

Read the full file on GitHub · 295 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 295 lines · 76 tokens per session scan A 28ee02bf0f09

Subscribe to this mod's changes

drizzle-orm-d1 is a skill published in the GitHub repository secondsky/claude-skills (257 stars, last pushed 8d ago), licensed MIT. It adds 76 tokens to every session and 2,445 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

drizzle-orm-d1 compared with skills from other repositories

drizzle-orm-d1 next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
drizzle-orm-d1secondsky/claude-skillsSkill2578d agoMITA76Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code