class DatabasePerTenant

Isolates tenants by assigning each a separate database.

The default database prefix is 'tenant_', configurable at construction.

Implements the 'database' arm of ITenantIsolationStrategy.

Constructors

DatabasePerTenant(prefix?: string)

Properties

readonly
kind: "database"

Methods

resolveDatabase(tenantId: string): string

Derive the database name for a tenant id.

Usage

import { DatabasePerTenant } from "multi-tenancy-plugin/src/index.ts";