(can-delete-tenant? tenant)True if tenant is not already deleted.
True if tenant is not already deleted.
(create-tenant-decision slug existing-slugs)Decide whether a tenant with the given slug can be created. Returns {:valid? bool}.
Decide whether a tenant with the given slug can be created. Returns {:valid? bool}.
(prepare-tenant {:keys [slug name settings]} tenant-id now)Build a complete tenant entity from creation input, id, and timestamp.
Build a complete tenant entity from creation input, id, and timestamp.
(prepare-tenant-deletion tenant now)Mark tenant as deleted with :status :deleted and :deleted-at timestamp.
Mark tenant as deleted with :status :deleted and :deleted-at timestamp.
(prepare-tenant-update existing-tenant update-data now)Merge approved update-data into existing-tenant with a fresh :updated-at.
Merge approved update-data into existing-tenant with a fresh :updated-at.
(slug->schema-name slug)Convert tenant slug to database schema name (hyphens become underscores, prefixed with tenant_).
Convert tenant slug to database schema name (hyphens become underscores, prefixed with tenant_).
(tenant-active? tenant)True if tenant is :active and not soft-deleted.
True if tenant is :active and not soft-deleted.
(tenant-deleted? tenant)True if tenant status is :deleted or :deleted-at is set.
True if tenant status is :deleted or :deleted-at is set.
(tenant-suspended? tenant)True if tenant status is :suspended.
True if tenant status is :suspended.
(update-tenant-decision existing-tenant update-data)Decide whether the proposed update-data is valid for existing-tenant.
Decide whether the proposed update-data is valid for existing-tenant.
(valid-schema-name? schema-name)True if schema-name is a safe tenant schema identifier — exactly the shape
slug->schema-name produces: a tenant_ prefix followed by lowercase
alphanumerics and underscores, within PostgreSQL's 63-char identifier limit.
SQL identifiers cannot be parameterized, so schema names are interpolated into DDL. This predicate is the defense-in-depth guard callers apply at the DDL boundary before any interpolation.
True if schema-name is a safe tenant schema identifier — exactly the shape slug->schema-name produces: a `tenant_` prefix followed by lowercase alphanumerics and underscores, within PostgreSQL's 63-char identifier limit. SQL identifiers cannot be parameterized, so schema names are interpolated into DDL. This predicate is the defense-in-depth guard callers apply at the DDL boundary before any interpolation.
(valid-slug? slug)Check if slug is a valid tenant identifier (lowercase alphanumeric with hyphens, 2-100 chars).
Check if slug is a valid tenant identifier (lowercase alphanumeric with hyphens, 2-100 chars).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |