Electric.Replication.Changes.TransactionFragment (electric v1.4.11)

View Source

Represents a transaction or part of a transaction from the replication stream.

The has_begin? and commit fields indicate which portion of a transaction the fragment represents:

  • Full transaction: has_begin? is true and commit is set
  • Start of a transaction: has_begin? is true but no commit
  • Middle of a transaction: has_begin? is false and no commit
  • End of a transaction: has_begin? is false but commit is set

Summary

Types

t()

@type t() :: %Electric.Replication.Changes.TransactionFragment{
  affected_relations: MapSet.t(Electric.Replication.Changes.relation_name()),
  change_count: non_neg_integer(),
  changes: [Electric.Replication.Changes.change()],
  commit: Electric.Replication.Changes.Commit.t() | nil,
  has_begin?: boolean(),
  last_log_offset: Electric.Replication.LogOffset.t() | nil,
  lsn: Electric.Postgres.Lsn.t() | nil,
  xid: Electric.Replication.Changes.xid() | nil
}

Functions

complete_transaction?(txn_fragment)

(macro)