drizzle-orm

drizzle-orm is a skill for Claude Code, Codex from monkilabs/opencastle. It costs 69 tokens per session (513 once invoked), scanned A, original, MIT.

A database toolkit for defining schemas and writing typed queries, joins, transactions, and data changes for PostgreSQL, MySQL, and SQLite. An ORM lets application code work with database tables through structured code instead of writing every query by hand.

In plain words
What is it for?
Use it to define tables and relationships, perform create/read/update/delete operations, write relational queries, run transactions, create migrations with drizzle-kit, and configure a database connection.
Why use it?
It helps keep database code and application types aligned while making migrations, relationships, partial reads, and transaction boundaries easier to manage.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/monkilabs/opencastle/drizzle
Any agent
npx skills add monkilabs/opencastle --skill drizzle
Clone the repo
git clone --depth 1 https://github.com/monkilabs/opencastle

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/monkilabs/opencastle/drizzle.svg)](https://agentmods.dev/skills/monkilabs/opencastle/drizzle)
Your own site
<a href="https://agentmods.dev/skills/monkilabs/opencastle/drizzle"><img src="https://agentmods.dev/badge/skills/monkilabs/opencastle/drizzle.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 513 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00069 $0.00513
Opus 5 $0.00034 $0.00257
Sonnet 5 $0.00014 $0.00103
Haiku 4.5 $0.00007 $0.00051

Measured 4d ago against content hash 7a7e37481dab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

drizzle-orm scanned grade A with 0 findings 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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (config.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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/orchestrator/plugins/drizzle/SKILL.md · 27 lines

What it actually says

Drizzle ORM

Gotchas

  • drizzle(client, { schema }) — omit { schema } and the db.query.* relational API silently does not exist.
  • relations() is ORM-level metadata only and creates no constraint. Define references(() => users.id, { onDelete: 'cascade' }) as well; you need both.
  • Types come from typeof table.$inferSelect / $inferInsert — never hand-write them.
  • SQL-like API (db.select().from()) for joins and aggregates; relational API (db.query.x.findMany({ with: {...} })) for nested reads. insert/update/delete give back nothing usable without .returning().
  • Inside db.transaction(async (tx) => ...) every call must use tx; a stray db call runs outside the transaction.
  • Prepared statements need sql.placeholder('id') + .prepare('name'), then .execute({ id }).
  • Partial selects (db.select({ id: users.id })) avoid loading unused columns; declare indexes in the table definition.

drizzle-kit

  • generate → review the SQL in the out dir → migrate. push is dev-only. Never edit generated SQL; fix the schema and regenerate. check validates migration history consistency.
  • A column rename generates DROP + ADD, i.e. data loss. Hand-write the migration file instead — ALTER TABLE users RENAME COLUMN old_name TO new_name; — then migrate applies it.
  • A new non-nullable column takes two migrations: add nullable → backfill → add .notNull() → migrate again.
  • The programmatic migrator needs a single connection: postgres(url, { max: 1 }), then migrate(drizzle(client), { migrationsFolder: './drizzle' }), then close it.
  • drizzle.config.ts must supply dialect, schema, out, and dbCredentials.url before any command runs.

Docs: https://orm.drizzle.team/

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 27 lines · 69 tokens per session scan A 7a7e37481dab

Subscribe to this mod's changes

drizzle-orm is a skill published in the GitHub repository monkilabs/opencastle (61 stars, last pushed 6d ago), licensed MIT. It adds 69 tokens to every session and 513 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

architecture-database-design

Master of PostgreSQL schema design, optimization, and safe migrations. Enforces strict conventions for IDs, indexes, JSONB, and transactional DDL. Use whenever modifying the data layer.

Sn4kyGit/antigravity-project-starter · 42 tokens

surf

Use this skill — NOT browser or webfetch — for ALL Surf crypto-data calls. 83 endpoints at localhost:8402/v1/surf/ covering CEX/DEX markets, on-chain SQL over 80+ ClickHouse tables (Ethereum, Base, Arbitrum, BSC, TRON, HyperEVM, Tempo), 100M+ labeled wallets, prediction markets (Polymarket + Kalshi), social/CT…

BlockRunAI/ClawRouter · 130 tokens

dinero-currency-patterns

Currency handling patterns for the Dinero.js money library. Use when working with multiple currencies, converting between currencies, defining custom currencies, storing monetary values in databases, or integrating with payment services like Stripe or PayPal. Triggers on currency conversion, database schema design for…

dinerojs/dinero.js · 71 tokens

ai-persistence/stores

Implement the MessageStore, RunStore, InterruptStore, MetadataStore contracts for @tanstack/ai-persistence against any database. defineAIPersistence, composePersistence overrides, critical invariants (full-replace saveThread, insert-if-absent createOrResume and interrupt create), authorize thread access…

TanStack/ai · 93 tokens

data-warehouse-experimentation

Running experiments out of the data warehouse instead of via dedicated experiment platforms. SQL-based assignment, exposure logging discipline, metric definitions in dbt models, statistical analysis in SQL or Python, variance reduction with CUPED, sequential testing, and the operational tradeoffs vs platforms like…

rampstackco/claude-skills · 157 tokens

system-table-change

Use when adding, removing, or modifying columns/indexes on system tables. Provides a checklist covering schema definitions, migrations, version gates, golden files, and test hashes.

cockroachdb/cockroach · 38 tokens