glapi-rls-guide
OfficialEnsure GLAPI multi-tenant data isolation.
Software Engineering#postgresql#trpc#multitenancy#row-level-security#database-security#session-variables#contextual-db
Authoradteco
Version1.0.0
Installs0
System Documentation
What problem does it solve?
GLAPI's multi-tenant databases need reliable Row Level Security and contextual session variables so that organization-specific queries cannot leak data between tenants, especially when repositories or services might inadvertently use global connections.
Core Features & Use Cases
- Session Variable Enforcement: Every contextual database connection sets
app.current_organization_idbefore executing queries, ensuring policies compare organization_id values accurately even across inserts, selects, updates, and deletes. - Context Module & Middleware: The context helpers and authenticated tRPC middleware create RLS-aware connections, validate organization UUIDs, and release clients safely at the end of each request.
- Repository Patterns & Troubleshooting: Services and repositories accept a contextual
db, follow thectx.dbpath, and include debug patterns for diagnosingnew row violates row-level security policyerrors, illustrating how to add RLS for new tables while keeping migrations aligned.
Quick Start
Use the GLAPI RLS guide to outline the steps for enabling PostgreSQL session variables, RLS policies, and contextual database connections when adding a new multi-tenant table.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: glapi-rls-guide Download link: https://github.com/adteco/glapi/archive/main.zip#glapi-rls-guide Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.