The resolved configuration behind use StatifierPersistence.Ecto.
ADR-0002 decision 3 requires that the generated schemas and the
migrations helper take the same options and cannot disagree. This module
is the single definition site that makes that true: __using__/1 builds
a Config at the host's compile time, and the migrations helper reads
the same struct (via for: HostModule) or funnels literal options
through the same new/1.
Options:
:repo- required, the host'sEcto.Repomodule:key- the surrogate-key scheme,:uxid(default),:uuid,:bigserial, or{module, opts}implementingStatifierPersistence.Ecto.KeyGenerator:table_prefix- prefix for the generated table names, default"statifier_":tables- per-table override map with keys:charts,:positions,:runs; an override replaces the whole name, prefix included:prefix- the Postgres schema (Ecto's@schema_prefix), defaultnil
Unknown options and unknown table keys raise ArgumentError - at the
host's compile time when reached through use.
Summary
Functions
Validates and resolves the options use StatifierPersistence.Ecto
accepts. Raises ArgumentError on anything malformed.
The table name (source) for table under this configuration: the
per-table override when one was given, otherwise the table prefix plus
the table's own name.
Types
Functions
Validates and resolves the options use StatifierPersistence.Ecto
accepts. Raises ArgumentError on anything malformed.
@spec table(t(), StatifierPersistence.Ecto.KeyGenerator.table()) :: String.t()
The table name (source) for table under this configuration: the
per-table override when one was given, otherwise the table prefix plus
the table's own name.