StatifierPersistence.Ecto (StatifierPersistence v0.1.0)

Copy Markdown View Source

Compile-time Ecto configuration on the host's own module (ADR-0002).

A host declares its persistence module once:

defmodule MyApp.Persistence do
  use StatifierPersistence.Ecto, repo: MyApp.Repo
end

and gets, with zero further options: the resolved configuration readable via MyApp.Persistence.__statifier_persistence__/1, and three Ecto schema modules - MyApp.Persistence.Chart, MyApp.Persistence.Position, MyApp.Persistence.Run - over the statifier_charts / statifier_positions / statifier_runs tables with UXID string primary keys (chart_ / pos_ / run_ prefixes).

Every knob is compile-time, on this use, never in application env (ADR-0002 decision 3), and the migrations helper consumes the same resolved configuration so schemas and DDL cannot disagree. See StatifierPersistence.Ecto.Config for the options (:key, :table_prefix, :tables, :prefix).

The engine identity columns (content_hash, session_id, run_id) are stored verbatim as strings and are never touched by the configured key scheme - ADR-0002 decision 1.