Trellis.Divergence (Trellis v0.1.0-alpha)

Copy Markdown View Source

One thing Trellis.self_check/3 found out of step, by kind:

  • :cell: the row exists on both sides but column differs at key. persisted is the target table's value and recomputed the fresh recompute's, both as Postgres renders them as text (nil for NULL).
  • :missing_row: the recompute produced key, but the target has no row for it.
  • :extra_row: the target has a row for key that the recompute didn't produce.
  • :missing_column: the definition expects column, but the target table doesn't have it.
  • :extra_column: the target table has column, but the definition doesn't expect it.
  • :capture: a table the target is computed from isn't being captured as Trellis installed it (a capture trigger missing, disabled or calling the wrong function, a capture function missing or with the wrong owner, the Trellis role missing a privilege, or the table joined a partition or inheritance hierarchy). detail says what, and table names the table (nil for a missing privilege). Trellis.self_check/3 reports these before, and instead of, comparing any rows.

Fields a kind doesn't carry are nil.

Summary

Types

What kind of divergence this is.

t()

Types

kind()

@type kind() ::
  :cell | :missing_row | :extra_row | :missing_column | :extra_column | :capture

What kind of divergence this is.

t()

@type t() :: %Trellis.Divergence{
  column: String.t() | nil,
  detail: String.t() | nil,
  key: String.t() | nil,
  kind: kind(),
  persisted: String.t() | nil,
  recomputed: String.t() | nil,
  table: String.t() | nil
}