Skip to content

base

sqllocks_spindle.domains.base

Base class for domain libraries.

Classes

Domain

Bases: ABC

Base class for all Spindle domains (Retail, Financial, etc.).

Parameters:

Name Type Description Default
schema_mode str

Schema layout variant (e.g., '3nf', 'star').

'3nf'
profile str

Name of a distribution profile to load from the domain's profiles/ directory. Defaults to "default".

'default'
overrides dict[str, Any] | None

Dict of "table.column" → value mappings that override any profile weights at generation time.

None

Example::

# Use the default profile with one tweak
domain = RetailDomain(overrides={
    "customer.loyalty_tier": {"Basic": 0.60, "Silver": 0.20, "Gold": 0.15, "Platinum": 0.05},
})

# Use a named profile
domain = HealthcareDomain(profile="medicare")
Attributes
available_profiles property

List available profile names for this domain.

name abstractmethod property

Domain name (e.g., 'retail', 'financial').

description abstractmethod property

Brief description of the domain.

domain_path property

Path to this domain's directory (for reference data lookup).

available_modes property

List available schema modes for this domain.

Methods:
get_schema()

Load and return the schema for the current mode.