drizzle-database

Models PostgreSQL schema structures and generates migrations using Drizzle ORM conventions.

601|129|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/ChatbotXIO/ChatbotX --skill drizzle-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-database
Source: https://github.com/ChatbotXIO/ChatbotX/tree/main/.agents/skills/drizzle-database
Command: npx skills add https://github.com/ChatbotXIO/ChatbotX --skill drizzle-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the risk and repetition of hand-managing PostgreSQL schema work by standardizing Drizzle ORM tables, enums, relations, migrations, and query patterns.

Core Features & Use Cases

  • Table Definitions: Create new pgTable models with shared columns, indexes, foreign keys, and naming conventions that match the ChatbotX database package.
  • Enum and Relation Design: Define constrained string fields with database enums and wire up one-to-one, one-to-many, and many-to-many relations in a consistent way.
  • Migration Workflow: Apply the expected sequence for schema edits, migration generation, migration execution, and database inspection.
  • Safe Querying: Use repository- and service-level query patterns for relational reads, SQL builder updates, inserts, and transactional multi-write operations.

Quick Start

Ask the skill to add or modify a ChatbotX database table, relation, or migration while preserving the shared column, enum, and transaction conventions.

Frequently Asked Questions about drizzle-database

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

FAQPage Schema
How do I create PostgreSQL tables with Drizzle ORM while maintaining consistent naming conventions?

Creating PostgreSQL tables with Drizzle ORM involves defining pgTable models using shared columns, indexes, and foreign keys that match your database package conventions to ensure structural consistency and prevent schema conflicts.

What is the correct workflow for generating and applying Drizzle ORM migrations?

The Drizzle ORM migration workflow requires a strict sequence of schema edits, migration generation, migration execution, and database inspection to safely apply PostgreSQL schema changes without introducing inconsistent table or relation states.

How do I handle transactional multi-write operations in Drizzle ORM queries?

Transactional multi-write operations in Drizzle ORM require repository- and service-level query patterns that wrap relational reads, SQL builder updates, and inserts within strict transactional handling to ensure data integrity.

Can I use database enums for constrained string fields in Drizzle ORM?

Yes, you can define constrained string fields in Drizzle ORM using pgEnum to wire up specific allowed values, ensuring database-level validation for PostgreSQL columns that require restricted value sets.

How do I wire up one-to-many and many-to-many relations in Drizzle ORM?

Wiring up Drizzle ORM relations requires configuring one-to-one, one-to-many, and many-to-many connections consistently within your pgTable definitions to prevent inconsistent relation changes across your PostgreSQL schema.

What are the limitations of package-scoped data access in Drizzle ORM?

Package-scoped data access in Drizzle ORM requires strict adherence to repository-level query rules, limiting direct database access outside designated boundaries to enforce safe querying and prevent inconsistent multi-write operations.