drizzle-best-practices

Drizzle ORM best practices for TypeScript projects using PostgreSQL. Use this skill when writing, reviewing, or optimizing Drizzle ORM schemas, queries, relations, migrations, or database configurations targeting Postgres. Apply these guidelines whenever you see drizzle-orm imports, pgTable definitions, drizzle-kit config files, or relational query patterns. Also use when setting up a new project with Drizzle + Postgres, migrating from another ORM, or troubleshooting type errors in Drizzle schemas.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "drizzle-best-practices" with this command: npx skills add honra-io/drizzle-best-practices/honra-io-drizzle-best-practices-drizzle-best-practices

Drizzle ORM Best Practices (PostgreSQL)

Comprehensive best practices guide for Drizzle ORM with PostgreSQL. Contains guidance across 8 categories, prioritized by impact to help you write correct, performant, and maintainable database code.

When to Apply

Reference these guidelines when:

  • Defining table schemas with pgTable
  • Writing select, insert, update, or delete queries
  • Setting up relations between tables using defineRelations or the legacy relations API
  • Configuring drizzle-kit for migrations (generate, push, pull)
  • Inferring TypeScript types from your schema
  • Choosing between the SQL-like API and the relational query API
  • Optimizing query performance with prepared statements or batch operations
  • Integrating Drizzle with serverless Postgres providers (Neon, Supabase, etc.)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Schema DesignCRITICALschema-
2Query PatternsCRITICALquery-
3RelationsHIGHrelations-
4MigrationsHIGHmigrations-
5Type SafetyMEDIUM-HIGHtypes-
6PerformanceMEDIUMperf-
7Database DriversMEDIUMdriver-
8Advanced PatternsLOWadvanced-

How to Use

Read individual reference files for detailed explanations and code examples:

references/engine-postgres.md          # Postgres-specific types, features, and patterns
references/schema-table-definitions.md
references/query-select-patterns.md
references/relations-defining.md
references/_sections.md                # Full index of all references

Each reference file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Links to official Drizzle documentation

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

drizzle-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
Web3

china-sportswear-outdoor-sourcing

Comprehensive sportswear and outdoor equipment sourcing guide for international buyers – provides detailed information about China's athletic apparel, footwear, outdoor gear, and accessories manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated
Web3

china-lighting-sourcing

Comprehensive lighting industry sourcing guide for international buyers – provides detailed information about China's LED, smart, outdoor, automotive, and specialty lighting manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated
Web3

china-furniture-sourcing

Comprehensive furniture industry sourcing guide for international buyers – provides detailed information about China's residential, office, hotel, outdoor, and custom furniture manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Archived SourceRecently Updated