Skip to content
Back to skills

Drizzle Orm

ASecurity

Use Drizzle ORM cleanly: typed schema tables, SQL migration inspection, prepared queries and serverless drivers

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
ai-agentstypescriptsqldatabaseperformance

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill drizzle-orm --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Drizzle Orm?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Drizzle Orm
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-drizzle-orm/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-drizzle-orm)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Use Drizzle ORM cleanly: typed schema tables, SQL migration inspection, prepared queries and serverless drivers
profile: standard
tags: drizzle, database, orm, typescript
---

# Drizzle ORM

Use when defining Drizzle schemas, generating migrations, or writing queries in TypeScript.

## Schema and migrations
- Keep table definitions, indexes, foreign keys, and constraints (`uniqueIndex`, `.notNull()`, `.references()`) together in schema files as the single source of truth.
- Run `drizzle-kit generate` to produce SQL migration files, review the SQL for table locks or unintended drops, commit migrations, and apply via `drizzle-kit migrate` or an explicit startup runner.
- Share inferred types (`typeof users.$inferSelect`, `typeof users.$inferInsert`) directly with validation schemas (`drizzle-zod`) instead of duplicating DTO interfaces.

## Queries and transactions
- Select only required columns (`db.select({ id: users.id, email: users.email })`) rather than `db.select()` when tables hold large blobs or sensitive hashes.
- Use `eq`, `and`, `inArray`, and `sql` tagged templates (never raw string concatenation) so all inputs remain parameterized.
- Wrap multi-step invariant writes in `db.transaction(async (tx) => ...)` and throw inside the callback to guarantee rollback.

## Drivers and performance
- Prepare hot-path queries with `.prepare(...)` where supported by long-lived servers; pick the HTTP/WebSocket driver (`neon-http`, `libsql`) intentionally for edge/serverless targets.

## Verify
Verify generated SQL diffs, run `tsc --noEmit`, and run integration tests covering constraints, typed joins, and transaction rollbacks.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.