Fly.Postgres.LSN (Fly Postgres v0.3.4) View Source
Data structure that represents a PostgreSQL LSN or Log Sequence Number.
Two LSN values can be compared using the replicated?/2
function. An LSN
associated with the DB modification has a source
of :insert
. On a replica
instance, that can be used to see when the insert has been replicated locally.
Link to this section Summary
Functions
After performing a database modification, calling current_wal_insert/1
returns a value that can be used to compare against a WAL value from the
replica database to determine when the changes have been replayed on the
replica.
When talking to a replica database, this returns a value for what changes have been replayed on the replica from the primary.
When talking to a replica database, this returns a value for what changes have been replayed on the replica from the primary.
Create a new Fly.Postgres.LSN
struct from the a queried WAL value.
Compare two Fly.Postgres.LSN
structs to determine if the transaction representing a
data change on the primary has been replayed locally.
Convert an LSN struct back into a text value.
Link to this section Types
Specs
Link to this section Functions
After performing a database modification, calling current_wal_insert/1
returns a value that can be used to compare against a WAL value from the
replica database to determine when the changes have been replayed on the
replica.
When talking to a replica database, this returns a value for what changes have been replayed on the replica from the primary.
Specs
When talking to a replica database, this returns a value for what changes have been replayed on the replica from the primary.
Specs
Create a new Fly.Postgres.LSN
struct from the a queried WAL value.
Compare two Fly.Postgres.LSN
structs to determine if the transaction representing a
data change on the primary has been replayed locally.
They are compared where the replay/replica value is in argument 1 and the insert value is in argument two.
Examples
repo |> last_wal_replay() |> replicated?(primary_lsn)
Specs
Convert an LSN struct back into a text value.