CouncilEx.Persistence.Schema.RunEvent (CouncilEx v0.1.0)

Copy Markdown View Source

Ecto schema for the <prefix>run_events table.

One row per persisted lifecycle event. Inserted by CouncilEx.Recorder.Ecto in broadcast order; :seq is a per-run monotonic counter assigned at insert time.

Event filtering

By default :member_token is not persisted — token chunks are high volume and PubSub-only is the right tradeoff (see docs/MULTI_REPLICA_RECORDER.md "persist at round/member boundaries"). Override via the :event_filter option on the recorder.

Payload shape

:payload is a JSON map. Each event type stores a different shape; consumers should pattern-match on :type first.

Summary

Types

t()

@type t() :: %CouncilEx.Persistence.Schema.RunEvent{
  __meta__: term(),
  id: term(),
  inserted_at: term(),
  payload: term(),
  run: term(),
  run_id: term(),
  seq: term(),
  type: term()
}

Functions

changeset(event, attrs)

@spec changeset(
  t()
  | %CouncilEx.Persistence.Schema.RunEvent{
      __meta__: term(),
      id: term(),
      inserted_at: term(),
      payload: term(),
      run: term(),
      run_id: term(),
      seq: term(),
      type: term()
    },
  map()
) :: Ecto.Changeset.t()