decode

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package decode defines logical-decoding contracts enforcing ST-4 and CO-4.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEvent

type ChangeEvent struct {
	Kind    ChangeKind
	LSN     LSN
	Key     int64
	OldKey  *int64
	Columns []Column
}

ChangeEvent is one decoded row change. OldKey is non-nil only when an update moved the key.

func (ChangeEvent) PresentColumns

func (e ChangeEvent) PresentColumns() []Column

PresentColumns returns only values present in the decoded row image.

type ChangeKind

type ChangeKind uint8

ChangeKind identifies a decoded row operation.

const (
	// Insert creates a row.
	Insert ChangeKind = iota + 1
	// Update changes a row.
	Update
	// Delete removes a row.
	Delete
)

func (ChangeKind) String

func (k ChangeKind) String() string

String returns the stable operation name.

type Column

type Column struct {
	Name    string
	Value   any
	Present bool
}

Column is one decoded column. Present=false means pgoutput omitted an unchanged TOAST value, so an applier must leave the target column untouched.

type LSN

type LSN uint64

LSN is a PostgreSQL log sequence number.

func (LSN) String

func (l LSN) String() string

String renders the PostgreSQL X/Y representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL