database-schema-expert

Design Supabase Postgres schemas and optimize Drizzle ORM queries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill database-schema-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema-expert
Source: https://github.com/Sanchay-T/influencer-platform-app/tree/main/.claude/skills/database-schema-expert
Command: npx skills add https://github.com/Sanchay-T/influencer-platform-app --skill database-schema-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expert knowledge on Supabase Postgres schema, Drizzle ORM patterns, normalized user tables, relationships, query patterns, and migrations.

Core Features & Use Cases

  • Schema Architecture: Normalized user tables and JSONB usage.
  • Drizzle ORM Patterns: Common queries and transactions.
  • Migration Strategy: Drizzle Migrate workflow.

Quick Start

Review /lib/db/schema.ts; use getUserProfile helper to query user data.

Frequently Asked Questions about database-schema-expert

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

FAQPage Schema
How do I design a normalized database schema for Postgres with Drizzle ORM?

Normalized database schemas in Drizzle ORM separate concerns across multiple tables with foreign key relationships, UUID primary keys, and JSONB fields for flexible metadata. Define schemas in /lib/db/schema.ts using Drizzle's table and relation helpers, then apply migrations to Supabase Postgres.

What's the best way to structure migrations in Drizzle for Postgres?

Drizzle Migrate workflows generate and apply migrations incrementally, tracking schema versions safely. Create migrations from your /lib/db/schema.ts definitions, review generated SQL, then deploy to Supabase Postgres in order to maintain consistency across environments.

How do I query user data efficiently with Drizzle ORM and normalized tables?

Use helper functions like getUserProfile to construct optimized queries across normalized user tables with proper joins and filtering. Drizzle's query builder constructs type-safe SQL, reducing N+1 problems and improving performance in Supabase Postgres.

Can I use JSONB fields in Drizzle schemas for Postgres metadata?

Yes, Drizzle supports JSONB columns natively in Postgres schemas, allowing flexible metadata storage alongside structured relational data. JSONB enables indexing and querying nested data while maintaining schema normalization for core entities.

Why should I use soft deletes with cascade relationships in database design?

Soft deletes and cascade relationships preserve referential integrity and audit trails while removing data logically. Configure cascade delete policies in Drizzle schemas to automatically clean up related records, protecting data consistency in multi-table environments.

Does Drizzle ORM work with Supabase Postgres for real-time applications?

Drizzle ORM integrates seamlessly with Supabase Postgres, supporting transactions, normalized schemas, and migrations. Supabase's real-time subscriptions work independently of the ORM layer, allowing you to combine Drizzle's type-safe queries with Postgres' native event broadcasting.