@multitenant/typeorm
v0.1.0
Published
Reference wiring: TypeORM DataSource + Postgres + @multitenant/database (shared DB & per-tenant URL) — Phase 8.7
Readme
@multitenant/typeorm
Optional reference helpers for TypeORM DataSource (Postgres) + @multitenant/database:
createSharedPostgresDataSource(url, dataSourceOptions?)— shared DSNgetOrCreateTenantPostgresDataSource(cache, resolved, tenants, options?)— per-tenant URL +BoundedTenantDbResourceCache<DataSource>
Peer: typeorm. You must await dataSource.initialize() before use; on cache eviction call dataSource.destroy() (see doc).
Docs: typeorm-postgres.md
