data-access-layer

Installation
SKILL.md

Data Access Layer

Overview

Don't scatter ORM calls across components and route handlers. Put every query behind a server-only data-access layer (DAL): small typed functions that take an explicit orgId and never return another tenant's rows. The rest of the app calls getProjects(orgId), not db.select(...). This centralizes tenant scoping, caching, and the place you write tests.

When to use

  • Any read or write to the database.
  • You catch yourself importing db into a React component.
  • You want one place to enforce "every query is scoped to the current org".

The pattern

Installs
7
GitHub Stars
2
First Seen
Jun 18, 2026