Binds the store to the database service it reads and writes through.
The database service the store reads and writes through
OptionaltenantColumn: string
The tenant column to stamp and conjoin; when omitted
the column is adopted from a 'column' strategy handed to
useIsolation, else it defaults to 'tenant_id'. Meant for a
store used OUTSIDE the multi-tenancy plugin; under the plugin, name the
column on the strategy instead, since the plugin always hands one over
and a different column here throws at useIsolation
Create a new record; returns the stored entity including its id.
Delete a record. Returns true if a record was deleted.
Retrieve all records of an entity for a tenant.
Receives the resolved isolation strategy. Accepts 'column' (adopting its
column unless a tenantColumn was given, in which case a disagreement
throws naming both); throws TenantStoreStrategyUnsupportedError
for 'schema' and 'database' — IRepository has no schema or database
switch, so a silent accept would leave the isolation logical-only.
An
ITenantDataStoreoverIDatabaseService, isolating tenants by a column stamped on every row.Constructed by
createDatabaseTenantDataStore(the factory the multi-tenancy plugin resolves inonInit), or directly by an application that holds its ownIDatabaseService(a test, thecustomarm).Since
0.9.0