drizzle

drizzle is a cursor rule for Cursor from nedcodes-ok/cursorrules-collection. It costs 0 tokens per session (322 once invoked), scanned A, original, MIT.

A set of project rules for Drizzle ORM, a TypeScript library for defining database tables, running queries, and creating migrations.

In plain words
What is it for?
Use it when building applications that read and write database data with Drizzle, including schema design, relations, indexes, transactions, and migration workflows.
Why use it?
It keeps database schemas, queries, migrations, and TypeScript types consistent while reducing unsafe SQL and accidental production changes.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when building applications that read and write database data with Drizzle, including schema design, relations, indexes, transactions, and migration workflows.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/nedcodes-ok/cursorrules-collection/drizzle
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.

Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collection

Made for: Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/drizzle/github.svg)](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/drizzle)
Your own site
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/drizzle"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/drizzle/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

Your own site · 80×15
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/drizzle"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/drizzle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.00322
Opus 5.5 $0.00000 $0.00129
Sonnet 5.5 $0.00000 $0.00064
Haiku 4.5 $0.00000 $0.00032

Measured 2mo ago against content hash 3bfcd210e17b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

drizzle 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 2mo ago.

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.

rules-mdc/tools/drizzle.mdc · 35 lines

What it actually says

Drizzle ORM Rules

Schema

  • Define all tables in a central schema file (db/schema.ts)
  • Use the appropriate column types for your database (pgTable, mysqlTable, sqliteTable)
  • Always define relations explicitly using the relations() function
  • Add indexes for columns used in WHERE clauses and JOINs

Queries

  • Use the query API (db.query.users.findMany()) for complex joins and nested data
  • Use the CRUD API (db.select().from()) for simple queries
  • Always use parameterized queries — never interpolate values into SQL strings
  • Use transactions (db.transaction()) for multi-step operations that must be atomic

Migrations

  • Generate migrations with drizzle-kit generate
  • Review generated SQL before applying — never auto-apply without inspection
  • Keep migration files in version control
  • Use drizzle-kit push for development, drizzle-kit migrate for production

Type Safety

  • Infer types from schema: type User = typeof users.$inferSelect
  • Use insert types for write operations: type NewUser = typeof users.$inferInsert
  • Do not manually define types that duplicate schema definitions

Anti-patterns

  • Do not use raw SQL when Drizzle's query builder can express the same query
  • Do not skip the migration step — always generate and apply migrations for schema changes
  • Do not mix different database dialects in the same project
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. 2mo ago First seen · 35 lines · 322 tokens per session scan A 3bfcd210e17b

Subscribe to this mod's changes

drizzle is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (38 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 322 tokens. 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-09-03.

Related

drizzle compared with cursor rules from other repositories

drizzle next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
drizzlenedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA0Cursor
26-data-persistenceorbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
mysql-autousrrname/cursorrulesCursor rule117mo agoISCA0Cursor
40-cache-redisaiagentwithdhruv/ai-dev-stackCursor rule115mo agoMITA0Cursor
23-app-startuporbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
29-screen-startuporbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor
21-ads-billingorbitalsonic/AndroidPilotCursor rule11mo agononeA0Cursor