#31 — Facade’s API for BusinessData PostgreSQL schemas access
Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned
Created: 2024-07-04 · Updated: 2025-09-15
Description
In order to have access to BusinessData from LlmEngine we need in this information to be in the Facade. Also see relevant https://github.com/Twill-AI/facade/issues/12.
Due to:
- Only one BusinessData storage (PostgresSQL schema) is expected to exist per tenant.
- This information would be stored in Facade under “master” tenant context (all calls from BusinessData are expected to be handled under “master” tenant).
- Tenants information will be cached in Facade’s memory.
the best place for “credentials to BusinessData access” inside Facade is in “tenant” (DbTenant) master table.
AC:
Facade has HTTP REST API to:Persist new BusinessData’s PostgreSQL schema and read-only user to access it with mapping to the specific tenant ID.(is already implemented as GET /tenants) Read all these mappings.
- Facade gets BusinessData’s PostgreSQL schema and read-only user as a response on “create tenant” API call. Update calls don’t affect access. “Delete tenant” 204 response from BusinessData is handled as “all data is removed on BusinessData side”, other results blocks tenant deletion on Facade side.
Cache for this mapping “tenant_id → BusinessData storage and user” is out of scope. Note that TenantsManager class caches tenants but not in form of DbTenant of Facade.- [
businessdata_ro_pg_roleandbusinessdata_pg_schema](https:
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets