pg-uses-project-id-for-multi-tenancy
IN premise
Every `PgApi` query includes `project_id` in its WHERE clause, providing multi-tenant isolation with no cross-project queries and composite primary keys `(id, project_id)`.
Summary
All database queries in the PgApi layer are scoped to a specific project, so one project's data can never leak into another's. This is enforced structurally through composite primary keys and mandatory project_id filtering, meaning multi-tenancy isolation is baked into the data model rather than relying on application-level checks.
Details
| Source | entries/2026/04/29/reasons_lib-pg.md |