Agent skill

Drizzle Orm Patterns

by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit

Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations.

MITAuto-check: notesDatabases

Install Drizzle Orm Patterns

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill drizzle-orm-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit drizzle-orm-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-typescript/skills/drizzle-orm-patterns .claude/skills/drizzle-orm-patterns && rm -rf skills-src

Use ~/.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/

Facts

Skill name
drizzle-orm-patterns
GitHub stars
355
Token cost
~1.5k tokens
SKILL.md length
425 words
Files
10 (incl. references)
Skills in repo
117
Repo updated
First seen
Licence
MIT

At a glance

Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations.

  • Works in 7 steps: Identify your database dialect - Choose… → Define your schema - Use the appropriate… → Set up relations - Define relations… → …
  • Any Drizzle ORM development including defining database schemas
  • SKILL.md covers Overview, When to Use, Quick Reference and Instructions, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Drizzle Orm Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including reference files (for example `references/best-practices.md`, `references/common-patterns.md` and `references/examples.md`).

It sits in Databases, covering Type safety and Database schema design. It works with Drizzle ORM, Microsoft SQL Server, MySQL and SQLite. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Any Drizzle ORM development including defining database schemas
  • Writing type-safe queries
  • Implementing relations
  • Managing transactions

Example prompts

  • “Use the drizzle-orm-patterns skill to provide comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries…”
  • “/drizzle-orm-patterns”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Grep, Glob

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Identify your database dialect - Choose PostgreSQL, MySQL, SQLite, MSSQL, or CockroachDB
  2. Define your schema - Use the appropriate table function (pgTable, mysqlTable, etc.)
  3. Set up relations - Define relations using relations() or defineRelations()
  4. Initialize the database client - Create your Drizzle client with proper credentials
  5. Write queries - Use the query builder for type-safe CRUD operations
  6. Handle transactions - Wrap multi-step operations in transactions when needed
  7. Set up migrations - Configure Drizzle Kit for schema management

What it can do on your machine

Read from SKILL.md and the folder at commit fe73fb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Drizzle Orm Patterns loads about 1.5k tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 104 tokens; SKILL.md has 425 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

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.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Grep, Glob

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 425 words, ~1,478 tokens.

Download SKILL.mdSave it as .claude/skills/drizzle-orm-patterns/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
drizzle-orm-patterns
description
Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob

Drizzle ORM Patterns

Overview

Expert guide for building type-safe database applications with Drizzle ORM. Covers schema definition, relations, queries, transactions, and migrations for all supported databases.

When to Use

  • Defining database schemas with tables, columns, and constraints
  • Creating relations between tables (one-to-one, one-to-many, many-to-many)
  • Writing type-safe CRUD queries
  • Implementing complex joins and aggregations
  • Managing database transactions with rollback
  • Setting up migrations with Drizzle Kit
  • Working with PostgreSQL, MySQL, SQLite, MSSQL, or CockroachDB

Quick Reference

DatabaseTable FunctionImport
PostgreSQLpgTable()drizzle-orm/pg-core
MySQLmysqlTable()drizzle-orm/mysql-core
SQLitesqliteTable()drizzle-orm/sqlite-core
MSSQLmssqlTable()drizzle-orm/mssql-core
OperationMethodExample
Insertdb.insert()db.insert(users).values({...})
Selectdb.select()db.select().from(users).where(eq(...))
Updatedb.update()db.update(users).set({...}).where(...)
Deletedb.delete()db.delete(users).where(...)
Transactiondb.transaction()db.transaction(async (tx) => {...})

Instructions

  1. Identify your database dialect - Choose PostgreSQL, MySQL, SQLite, MSSQL, or CockroachDB
  2. Define your schema - Use the appropriate table function (pgTable, mysqlTable, etc.)
  3. Set up relations - Define relations using relations() or defineRelations()
  4. Initialize the database client - Create your Drizzle client with proper credentials
  5. Write queries - Use the query builder for type-safe CRUD operations
  6. Handle transactions - Wrap multi-step operations in transactions when needed
  7. Set up migrations - Configure Drizzle Kit for schema management

Examples

Example 1: Basic Schema and Query
typescript
import { pgTable, serial, text } from 'drizzle-orm/pg-core';
import { drizzle } from 'drizzle-orm/node-postgres';
import { eq } from 'drizzle-orm';

export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name').notNull(),
  email: text('email').notNull().unique(),
});

const db = drizzle(process.env.DATABASE_URL);

const [user] = await db.select().from(users).where(eq(users.id, 1));
Example 2: CRUD Operations
typescript
import { eq } from 'drizzle-orm';

// Insert
const [newUser] = await db.insert(users).values({
  name: 'John',
  email: 'john@example.com',
}).returning();

// Update
await db.update(users)
  .set({ name: 'John Updated' })
  .where(eq(users.id, 1));

// Delete
await db.delete(users).where(eq(users.id, 1));
Example 3: Transaction with Rollback
typescript
await db.transaction(async (tx) => {
  const [from] = await tx.select().from(accounts)
    .where(eq(accounts.userId, fromId));

  if (from.balance < amount) {
    tx.rollback();
  }

  await tx.update(accounts)
    .set({ balance: sql`${accounts.balance} - ${amount}` })
    .where(eq(accounts.userId, fromId));
});

See references/transactions.md for advanced transaction patterns.

Best Practices

  1. Type Safety: Always use TypeScript and leverage $inferInsert / $inferSelect
  2. Relations: Define relations using the relations() API for nested queries
  3. Transactions: Use transactions for multi-step operations that must succeed together
  4. Migrations: Use generate + migrate in production, push for development
  5. Indexes: Add indexes on frequently queried columns and foreign keys
  6. Soft Deletes: Use deletedAt timestamp instead of hard deletes when possible
  7. Pagination: Use cursor-based pagination for large datasets
  8. Query Optimization: Use .limit() and .where() to fetch only needed data
Show full SKILL.md (129 more words)Show less

Constraints and Warnings

  • Foreign Key Constraints: Always define references using arrow functions () => table.column to avoid circular dependency issues
  • Transaction Rollback: Calling tx.rollback() throws an exception - use try/catch if needed
  • Returning Clauses: Not all databases support .returning() - check your dialect compatibility
  • Batch Operations: Large batch inserts may hit database limits - chunk into smaller batches
  • Migrations in Production: Always test migrations in staging before applying to production

References

Core Concepts
Advanced Topics

© giuseppe-trisciuoglio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in plugins/developer-kit-typescript/skills/drizzle-orm-patterns of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/best-practices.md
  • references/common-patterns.md
  • references/examples.md
  • references/migrations.md
  • references/patterns.md
  • references/queries-joins-aggregations.md
  • references/relations.md
  • references/schema-definition.md
  • references/transactions.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

Drizzle Orm Patterns 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.

Drizzle Orm Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Drizzle Orm Patterns this skillgiuseppe-trisciuoglio/developer-kit355—~1.5kAutomated safety check: NotesMIT
SQL Expertaiskillstore/marketplace430—~3.4kAutomated safety check: PassNone
Better Drizzlealmeidazs/better-drizzle347—~1.7kAutomated safety check: PassApache-2.0
Golang Databaseunxed/f42412 repos~2.9kAutomated safety check: PassMIT
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
SQL ProJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT

Similar skills

  • SQL Expert

    aiskillstore/marketplace

    Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server.

    430 GitHub stars~3.4k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    347 GitHub stars~1.7k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    241 GitHub starsUsed in 2 repos~2.9k tokens
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 17 days ago
    DatabasesAuto-check passed
  • SQL Pro

    Jeffallan/claude-skills

    Optimizes SQL queries and designs schemas using CTEs, window functions, covering indexes and EXPLAIN ANALYZE, with notes on dialect differences between major databases.

    12k GitHub stars~1.3k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • Agent SQL Pro

    xiaoyuge886/aigc

    Expert SQL developer specializing in complex query optimization, database design, and performance tuning across PostgreSQL, MySQL, SQL Server, and Oracle.

    198 GitHub stars~315 tokensUpdated 2 mo ago
    DatabasesAuto-check passed

More from giuseppe-trisciuoglio/developer-kit

All 117 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    355 GitHub stars~1.3k tokensUpdated 28 days ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    355 GitHub stars~2.2k tokensUpdated 28 days ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    355 GitHub stars~2.5k tokensUpdated 28 days ago
    Auto-check: notes
  • PR Review Comments

    giuseppe-trisciuoglio/developer-kit

    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line.

    355 GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    355 GitHub stars~3.9k tokensUpdated 28 days ago
    Auto-check: notes
  • AWS SDK Java V2 Secrets Manager

    giuseppe-trisciuoglio/developer-kit

    Provides AWS Secrets Manager patterns for AWS SDK for Java 2.x, including secret retrieval, caching, rotation-aware access, and Spring Boot integration.

    355 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check: notes

Categories

Questions about Drizzle Orm Patterns

What does Drizzle Orm Patterns do?

Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Drizzle Orm Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations.

When should I use Drizzle Orm Patterns?

Drizzle Orm Patterns fits situations like: any Drizzle ORM development including defining database schemas; writing type-safe queries; implementing relations; managing transactions.

How do I install Drizzle Orm Patterns in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill drizzle-orm-patterns -a claude-code`. Or copy the skill folder (plugins/developer-kit-typescript/skills/drizzle-orm-patterns in giuseppe-trisciuoglio/developer-kit) into .claude/skills/drizzle-orm-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Drizzle Orm Patterns in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill drizzle-orm-patterns -a codex`. Or copy the skill folder (plugins/developer-kit-typescript/skills/drizzle-orm-patterns in giuseppe-trisciuoglio/developer-kit) into .agents/skills/drizzle-orm-patterns in your project. Codex loads it when a task matches its description.

Can I use Drizzle Orm Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add giuseppe-trisciuoglio/developer-kit --skill drizzle-orm-patterns -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-patterns, .gemini/skills/drizzle-orm-patterns, .github/skills/drizzle-orm-patterns and .opencode/skills/drizzle-orm-patterns in your project.

What does Drizzle Orm Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Drizzle Orm Patterns is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Grep, Glob.

Does Drizzle Orm Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Drizzle Orm Patterns safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Drizzle Orm Patterns use?

Drizzle Orm Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Drizzle Orm Patterns use?

About 1.5k tokens (SKILL.md is roughly 5.9k 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 13k tokens, read only when the agent opens those files.

What are the alternatives to Drizzle Orm Patterns?

Skills that share tags, products or a category with Drizzle Orm Patterns: SQL Expert (aiskillstore/marketplace, 430 stars), Better Drizzle (almeidazs/better-drizzle, 347 stars), Golang Database (unxed/f4, 241 stars) and Database Expert (cin12211/orca-q, 224 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Drizzle Orm Patterns?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 355 GitHub stars. The repository holds 117 skills in this directory. The repository was last updated on September 10, 2026.

Source: giuseppe-trisciuoglio/developer-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.