roedyrustam/vibes-plug/database-orm-expert
- community
Checking that the SKILL.md file is still in the repository.
Unified database ORM, schema migrations, edge DBs, and Supabase CLI / Database ORM terpadu, migrasi skema, edge DB, dan Supabase CLI.
Install
npx vskill@latest install roedyrustam/vibes-plug/database-orm-expertSKILL.md
Unified Database & ORM Expert (2026 Production Edition)
<a name="english"></a>
English
Orchestration & Integration
Connects and orchestrates with domain skills:
- Backend & Runtimes:
js-backend-expert,python-programming-expert,go-programming-expert, andrust-programming-expertfor integrating Drizzle ORM, Prisma 6, SQLx, and SQLAlchemy/SQLModel. - FinTech & SaaS:
saas-billing,saas-multi-tenant,double-entry-ledger-fintech-expert, anddoku-payment-gatewayfor strict atomic database transactions (SELECT ... FOR UPDATE), distributed locks, tenant isolation via RLS, and SNAP BI idempotent records. - AI & Vectors:
vector-db-rag-expertfor pgvector 0.8+ HNSW indexing and high-dimensional cosine similarity embeddings. - Security & Cloud:
supabase-security-expert,fga-rebac-authorization-expert,ci-cd-devops-architect, andcloud-hosting-expertfor automated migration pipelines, blue-green deployments, and pooler infrastructure. - Master Orchestrators:
brainstormingandzero-to-prod-orchestrator(Phase 3: Schema & Database Architecture).
Description
Production-grade guide for relational schema design, ORM selection, zero-downtime Expand-and-Contract migrations, pessimistic concurrency locking, query optimization, and edge serverless database drivers. Covers Drizzle ORM v0.39+, Prisma 6 (TypedSQL & Relation Joins), Supabase CLI, and Edge Databases (Neon Serverless Postgres, Cloudflare D1, Turso libSQL, Upstash Redis).
Trigger Conditions
- Designing or migrating a production schema (blue-green, Expand-and-Contract).
- Choosing between Drizzle ORM, Prisma 6, Kysely, or SQLx.
- Writing complex queries with joins, cursor pagination, or atomic row locks.
- Optimizing slow queries, missing FK indexes, or N+1 problems.
- Building edge-compatible serverless database connections (HTTP/WebSocket poolers).
- Executing Supabase CLI migrations and Row-Level Security (RLS) policies.
Core ORM & Query Strategies
ORM Selection Matrix (2026)
| Criteria | Drizzle ORM (v0.39+) | Prisma 6 | Kysely | |
|---|---|---|---|---|
| Type Safety | SQL-first, zero-codegen TypeScript inference | Schema-first (schema.prisma) + TypedSQL | Pure type-safe SQL query builder | |
| Cold Start & Bundle | Ultra-lightweight (<35KB, zero binary) | Wasm/Rust query compiler (~1.5MB) | Minimal (<20KB) | |
| Relational Queries | db.query.table.findMany({ with }) (Single SQL join) | relationLoadStrategy: "join" | Explicit .innerJoin() | |
| Edge Runtime | Native (Cloudflare Workers, Vercel Edge, Bun) | Native via @prisma/adapter-neon / D1 | Native | |
| Migrations | drizzle-kit generate & drizzle-kit migrate | prisma migrate dev / deploy | Custom migration runner |
Recommendation: Prefer Drizzle ORM for edge-first apps, Hono/Bun backends, and performance-critical systems. Choose Prisma 6 for teams preferring declarative .prisma modeling and TypedSQL.
1. Drizzle ORM v0.39+ Production Schema & Atomic Locking
Always index foreign keys explicitly, enforce TIMESTAMPTZ, and use FOR UPDATE row locks on financial or inventory mutations.
2. Keyset (Cursor) Pagination Pattern
Never use OFFSET on tables exceeding 50,000 rows (OFFSET 100000 forces Postgres to scan and discard 100,000 rows). Always use composite (createdAt, id) keyset cursors:
Zero-Downtime Migrations (Expand and Contract Protocol)
Never execute breaking DDL changes (DROP COLUMN, RENAME COLUMN, or locking ALTER TABLE ... ADD COLUMN ... NOT NULL without default) in a single release while old application containers are still serving traffic.
- Phase 1 (Expand): Add nullable column or new table; create indexes using
CREATE INDEX CONCURRENTLYto avoid blocking writes. - Phase 2 (Dual-Write): Update application code to write to both old and new columns; read from old with fallback.
- Phase 3 (Chunked Backfill): Backfill historical rows in small batches (
LIMIT 2000) withFOR UPDATE SKIP LOCKEDto avoid replication lag and table locks. - Phase 4 (Cutover Read & Contract): Switch reads to the new column, remove dual-write code, and validate constraints using
NOT VALIDfollowed byVALIDATE CONSTRAINT.
Edge & Serverless Drivers + Cache-Aside
Verification Checklist
- [ ] Every foreign key column has a corresponding B-Tree index (
idx_<table>_<fk>). - [ ] Financial balances and monetary quantities use
BIGINTminor units (cents/sen) orNUMERIC(19,4), neverFLOAT/REAL. - [ ] Multi-tenant tables enforce Row-Level Security (
ALTER TABLE ... ENABLE ROW LEVEL SECURITY) and tenant ID predicates. - [ ] Production migrations never run
prisma db pushordrizzle-kit push; versioned SQL files are audited viavibes db:eval. - [ ] High-concurrency state transitions use
SELECT ... FOR UPDATEor optimistic version increments.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/database-orm-expert/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 10
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roedyrustam/vibes-plug/database-orm-expert)