@tank/drizzle-orm-mastery

Installation
SKILL.md

Drizzle ORM Mastery

Core Philosophy

  1. SQL-first, not SQL-hidden -- Drizzle maps 1:1 to SQL. Learn SQL patterns and Drizzle follows. If the query builder feels awkward, write the SQL first, then translate.
  2. Schema is the source of truth -- TypeScript schema definitions drive migrations, queries, and type inference. Change the schema, regenerate migrations, never hand-edit SQL files.
  3. Push for prototyping, migrate for production -- Use drizzle-kit push during development for instant schema sync. Switch to drizzle-kit generate + migrate before deploying to shared environments.
  4. Infer types, never duplicate them -- Extract types from schema with typeof and $inferSelect / $inferInsert. Manually typed interfaces drift from the actual schema.
  5. Choose the right query API -- Use the SQL-like query builder (db.select()) for complex queries with joins and subqueries. Use the relational queries API (db.query) for nested object fetching with with.

Quick-Start: Common Problems

"How do I define a schema?"

import { pgTable, integer, varchar, timestamp } from "drizzle-orm/pg-core";
Installs
–
GitHub Stars
1
First Seen
–
@tank/drizzle-orm-mastery — tankpkg/packages