drizzle

Automate Drizzle ORM schema design and migrations for PostgreSQL projects.

30|10|Updated Aug 5, 2024
One-click install
npx skills add https://github.com/find-xposed-magisk/lobe-chat --skill drizzle-find-xposed-magisk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle
Source: https://github.com/find-xposed-magisk/lobe-chat/tree/main/.agents/skills/drizzle
Command: npx skills add https://github.com/find-xposed-magisk/lobe-chat --skill drizzle-find-xposed-magisk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Drizzle ORM schema and database guide helps developers design, implement, and maintain typed, scalable database schemas and migrations with Drizzle, reducing boilerplate and inconsistencies.

Core Features & Use Cases

  • Drizzle schema style guide with helpers, naming conventions, and patterns for tables, columns, and timestamps.
  • Migration guidance and best practices, including idempotent operations and meaningful file naming.
  • Use Case: Define a users table with id, created_at, and updated_at timestamps, then generate and apply migrations in a type-safe manner.

Quick Start

Define a new users table in src/database/schemas with id and timestamps, then run the migrations.

Frequently Asked Questions about drizzle

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

FAQPage Schema
How do I define a Drizzle ORM schema with type-safe columns in PostgreSQL?

To define a Drizzle ORM schema for PostgreSQL, you create type-safe table definitions using helpers for columns like id and timestamps. This standardizes schema design and reduces boilerplate inconsistencies.

What is the best way to generate and apply Drizzle migrations in a Node.js project?

The best way to apply Drizzle migrations is by following guidance on idempotent operations and meaningful file naming. This ensures database changes are applied consistently and safely within your Node.js project.

How do I configure drizzle.config.ts for my PostgreSQL database?

You configure drizzle.config.ts by applying provided configuration conventions for your PostgreSQL database. This setup file directs how Drizzle ORM connects and manages your schema and migration files.

Does Drizzle ORM work with TypeScript for type-safe database queries?

Yes, Drizzle ORM works natively with TypeScript to enable type-safe query patterns. This ensures your database queries and schema definitions are fully typed end-to-end within your Node.js projects.

What naming conventions should I use for Drizzle schema columns and timestamps?

You should use provided schema helpers and naming conventions for Drizzle tables, columns, and timestamps. This includes standardizing fields like created_at and updated_at to maintain a scalable database schema.

How do I write idempotent Drizzle migrations for schema updates?

You write idempotent Drizzle migrations by following best practices that ensure operations can run multiple times without causing errors. This standardizes your migration guidance and meaningful file naming for safer updates.