database-architect

Design normalized PostgreSQL schemas and Drizzle ORM definitions.

14|1|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/marcioaltoe/claude-craftkit --skill database-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-architect
Source: https://github.com/marcioaltoe/claude-craftkit/tree/main/plugins/db-tools/skills/database-architect
Command: npx skills add https://github.com/marcioaltoe/claude-craftkit --skill database-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers in crafting normalized, type-safe PostgreSQL schemas using Drizzle ORM, with emphasis on migrations, constraints, and scalable design.

Core Features & Use Cases

  • Schema Design: Create normalized tables with proper keys and relationships.
  • Drizzle ORM Integration: Generate type-safe definitions and insert/select types.
  • Migrations & Indexes: Plan migrations and indexing strategies for performance.

Quick Start

Create a Drizzle table for a sample product catalog with id, name, and price, including createdAt and updatedAt timestamps.

Frequently Asked Questions about database-architect

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

FAQPage Schema
How do I design a normalized PostgreSQL schema with Drizzle ORM?

Design normalized PostgreSQL schemas by defining Drizzle ORM tables with proper primary keys, foreign-key constraints, and relationships. Enforce 3NF normalization, use UUIDv7 primary keys, add timezone-aware timestamps, and export type-safe Select and Insert schemas for application use.

What's the best way to handle migrations and indexing in Drizzle?

Plan migrations by versioning schema changes and defining indexes on frequently queried columns. Drizzle ORM generates migration files from schema definitions, enabling you to apply incremental updates while maintaining data integrity and query performance.

Can I use Drizzle ORM for multi-tenant PostgreSQL databases?

Yes, Drizzle ORM supports multi-tenant architectures through normalized schemas with tenant isolation keys, foreign-key constraints, and JSONB columns for flexible tenant-specific data. Design tables with explicit tenant references and cascade rules for data consistency.

How do I implement soft deletes and automatic timestamps in Drizzle?

Add optional deletedAt columns for soft deletes and createdAt/updatedAt timestamps with timezone awareness in Drizzle table definitions. Configure automatic updates on timestamps and use Drizzle's type-safe exports to ensure insert and select operations respect these fields.

Does Drizzle ORM work with PostgreSQL JSONB and array types?

Yes, Drizzle ORM fully supports PostgreSQL JSONB columns and array types. Use JSONB for semi-structured data within normalized tables and arrays for storing multiple values, enabling flexible schema design while maintaining type safety through Drizzle's type definitions.

What foreign-key constraints should I define in a Drizzle schema?

Define explicit foreign-key constraints in Drizzle with cascade rules—CASCADE for dependent deletes, RESTRICT to prevent orphaned records, or SET NULL for optional relationships. Specify constraints in table definitions to enforce referential integrity and prevent invalid data.