grey-haven-data-modeling

Design PostgreSQL schemas with SQLModel, Drizzle ORM, and RLS policies.

2|1|Updated Sep 16, 2024
One-click install
npx skills add https://github.com/mvandermeulen/nvim --skill grey-haven-data-modeling-mvandermeulen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grey-haven-data-modeling
Source: https://github.com/mvandermeulen/nvim/tree/main/.claude/skills/data-modeling
Command: npx skills add https://github.com/mvandermeulen/nvim --skill grey-haven-data-modeling-mvandermeulen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates inconsistencies in database schema design for multi-tenant SaaS applications by enforcing strict naming conventions, tenant isolation, and standardized field requirements.

Core Features & Use Cases

  • Multi-Tenant Enforcement: Ensures every table includes a tenant_id with Row Level Security (RLS) policies for secure data isolation.
  • Standardized Schema Patterns: Provides templates for SQLModel and Drizzle ORM that include mandatory fields like created_at, updated_at, and proper indexing.
  • Use Case: When architecting a new feature, use this skill to generate a compliant table schema that automatically includes the necessary foreign keys, indexes, and RLS policies required by the Grey Haven platform.

Quick Start

Use the grey-haven-data-modeling skill to generate a new SQLModel table definition for a project entity that includes tenant isolation and standard audit timestamps.

Frequently Asked Questions about grey-haven-data-modeling

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

FAQPage Schema
How do I design a multi-tenant PostgreSQL schema with RLS policies?

To design a multi-tenant PostgreSQL schema with RLS, you must enforce a mandatory tenant_id field on every table for secure data isolation. This skill generates compliant tables with proper indexing and Row Level Security configurations.

How do I create SQLModel tables that enforce tenant isolation?

Creating SQLModel tables that enforce tenant isolation involves adding a mandatory tenant_id column and defining RLS policies in PostgreSQL. This skill provides standardized templates that automatically include these fields and audit timestamps.

Does Drizzle ORM support Row Level Security policies for multi-tenant applications?

Drizzle ORM supports structuring multi-tenant schemas with Row Level Security policies by ensuring tables include mandatory tenant_id fields. This skill provides standardized Drizzle schema patterns that satisfy tenant isolation requirements.

What is the best way to standardize database naming conventions across a multi-tenant SaaS application?

Standardizing database naming conventions across a multi-tenant SaaS application is achieved by enforcing strict rules like snake_case for tables and fields. This skill eliminates schema inconsistencies by generating compliant definitions automatically.

Why does my multi-tenant database schema lack proper indexing for tenant isolation?

A multi-tenant database schema lacks proper indexing when standard patterns for tenant_id fields and foreign keys are not applied. This skill resolves this by generating performance-optimized indexes alongside required RLS policies.