Skip to content

basalt / comments/src / SINGLE_TENANT_SCOPE

Variable: SINGLE_TENANT_SCOPE ​

> const SINGLE_TENANT_SCOPE: "@single" = '@single'

Defined in: comments/src/comments.ts:93

Store key every comment is filed under when the app has no tenancy at all. The CommentStore contract is tenant-keyed, so a single-tenant app still needs one stable key — it just shouldn't have to invent it.

A sentinel no tenant id can equal: @ is outside @basaltkit/tenancy's grammar, and a context or explicit tenant carrying it is refused with CommentTenantReservedError. It used to be 'default' — a perfectly valid tenant id, so a tenant named default read, edited and deleted the single-tenant comments. Rows written under 'default' by a single-tenant app must be re-keyed once (see the changelog for the migration).

Released under the MIT License.