AshReplicant.Checkpoint (AshReplicant v0.2.0)

Copy Markdown View Source

use AshReplicant.Checkpoint, repo: MyApp.Repo, domain: MyApp.Domain generates the bundled AshPostgres checkpoint resource (table ash_replicant_checkpoints) bound to the host's repo and domain.

One row per replication slot: slot_name (primary key) and the durable commit_lsn watermark. The sink upserts it in the same transaction as the mirrored changes, which is what gives effect-once (dup = 0) semantics.

A macro is required because an AshPostgres resource needs its host repo at compile time; ash_replicant cannot hardcode it.