SysTime.Schema (SysTime v0.1.0)

Copy Markdown View Source

Defines a temporal Ecto schema and its read-only history counterpart.

Use this module instead of Ecto.Schema, then call temporal_schema/2:

defmodule MyApp.Shareholder do
  use SysTime.Schema

  temporal_schema "shareholders" do
    field :name, :string
    belongs_to :company, MyApp.Company
  end
end

The generated History schema deliberately contains no associations and no primary key. Historical rows are values, not independently writable entities.

Summary

Functions

Defines the live schema and a nested History schema over <source>_history.

Functions

temporal_schema(source_ast, list)

(macro)

Defines the live schema and a nested History schema over <source>_history.