Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitPosition ¶
type CommitPosition string
CommitPosition represents a position in the input stream
type Data ¶
type Data struct { Action string `json:"action"` // "I" -- insert, "U" -- update, "D" -- delete, "T" -- truncate Timestamp string `json:"timestamp"` // ISO8601, i.e. 2019-12-29 04:58:34.806671 LSN string `json:"lsn"` Schema string `json:"schema"` Table string `json:"table"` Columns []Column `json:"columns"` Identity []Column `json:"identity"` Metadata Metadata `json:"metadata"` // pgstream specific metadata }
Data contains the wal data properties identifying the table operation.
type Event ¶
type Event struct { Data *Data CommitPosition CommitPosition }
Event represents the WAL information. If the data is nil but there's a commit position present, it represents a keep alive event that needs to be checkpointed.
type Metadata ¶
type Metadata struct { SchemaID xid.ID `json:"schema_id"` // the schema ID the event was stamped with TablePgstreamID string `json:"table_pgstream_id"` // the ID of the table to which the event belongs // This is the Pgstream ID of the "id" column(s). We track this specifically, as we extract it from the event // in order to use as the ID for the record. InternalColIDs []string `json:"id_col_pgstream_id"` // This is the Pgstream ID of the "version" column. We track this specifically, as we extract it from the event // in order to use as the version when working with optimistic concurrency checks. InternalColVersion string `json:"version_col_pgstream_id"` }
Metadata is pgstream specific properties to help identify the id/version within the wal event as well as some pgstream unique immutable ids for the schema and the table it relates to.
func (Metadata) IsEmpty ¶
IsEmpty returns true if the pgstream metadata hasn't been populated, false otherwise.
func (Metadata) IsIDColumn ¶
IsIDColumn returns true if the column id on input is part of the pgstream identified identity columns.
func (Metadata) IsVersionColumn ¶
IsVersionColumn returns true if the column id on input matches the pgstream identified version column.