drizzle

Enforce Drizzle ORM conventions for camelCase columns, pgTable usage, and v2 relations.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill drizzle-esposter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/drizzle
Command: npx skills add https://github.com/Esposter/Esposter --skill drizzle-esposter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes Drizzle ORM practices to ensure column names match TS properties, uses pgTable wrappers for metadata, and enforces consistent schema placement, select patterns, and v2 relation definitions across codebases.

Core Features & Use Cases

  • Column naming: camelCase must exactly match the TypeScript property keys.
  • Table definitions and relations: use pgTable with proper schema scoping and define relations via defineRelationsPart (v2).
  • Apply in: writing or modifying DB schema files in packages/db-schema and in tRPC routers to ensure consistent data modeling and safer migrations.

Quick Start

Apply these conventions when writing or updating Drizzle ORM schemas in your project.

Frequently Asked Questions about drizzle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent column naming in Drizzle ORM schemas?

Use pgTable wrappers for table definitions and defineRelationsPart for v2 relations. Applying these conventions to database schema files and tRPC routers ensures proper schema scoping, explicit relational mapping, and compatibility with v2 definitions in field files.

Where should I place Drizzle ORM schema files to maintain conventions?

Drizzle ORM schema files should be placed within the packages/db-schema directory. Enforcing this specific schema placement ensures consistent data modeling, safer migrations, and standardized relational mapping across the entire codebase.

Does Drizzle ORM v2 support explicit relational mapping for tRPC routers?

Yes, Drizzle ORM v2 supports explicit relational mapping for tRPC routers. By using defineRelationsPart, you ensure proper relational mapping and compatibility with v2 relation definitions in field files for safer data querying.

What is the best way to standardize Drizzle ORM table definitions across a codebase?

The best way to standardize Drizzle ORM table definitions is using pgTable wrappers with proper schema scoping. This enforces explicit naming, consistent metadata application, and compatible v2 relation definitions across all database schema files.

Why do my Drizzle ORM select patterns return inconsistent data structures?

Inconsistent Drizzle ORM select patterns often result from unstandardized schema definitions. Enforcing consistent select patterns, explicit column naming, and proper relational mapping via pgTable ensures predictable data modeling and safer database migrations.