postgres

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchWriter

type BatchWriter struct {
	// contains filtered or unexported fields
}

BatchWriter is a WAL processor implementation that batches and writes wal events to a Postgres instance.

func NewBatchWriter

func NewBatchWriter(ctx context.Context, config *Config, opts ...Option) (*BatchWriter, error)

NewBatchWriter returns a postgres processor that batches and writes data to the configured postgres instance.

func (*BatchWriter) Close

func (w *BatchWriter) Close() error

func (*BatchWriter) Name

func (w *BatchWriter) Name() string

func (*BatchWriter) ProcessWALEvent

func (w *BatchWriter) ProcessWALEvent(ctx context.Context, walEvent *wal.Event) (err error)

ProcessWalEvent is called on every new message from the wal. It can be called concurrently.

type Config

type Config struct {
	URL              string
	BatchConfig      batch.Config
	SchemaLogStore   schemalogpg.Config
	DisableTriggers  bool
	OnConflictAction string
}

type Option

type Option func(*BatchWriter)

func WithCheckpoint

func WithCheckpoint(c checkpointer.Checkpoint) Option

func WithLogger

func WithLogger(l loglib.Logger) Option

Jump to

Keyboard shortcuts

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