Electric.Replication.TransactionBuilder (electric v1.4.13)
View SourceBuilds complete transactions from a stream of TransactionFragments.
Takes TransactionFragments containing begin, commit, and changes, and builds up Transaction structs. Returns complete transactions when a fragment with a commit is seen.
Summary
Types
@type t() :: %Electric.Replication.TransactionBuilder{ transaction: nil | Electric.Replication.Changes.Transaction.t() }
Functions
@spec build(Electric.Replication.Changes.TransactionFragment.t(), t()) :: {[Electric.Replication.Changes.Transaction.t()], t()}
Build transactions from a TransactionFragment.
Returns a tuple of {results, state} where results is a list of complete transactions, and state is the updated builder state containing any partial transaction.