postgres

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 22 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 {
	*Writer
	// 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 ...WriterOption) (*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 BulkIngestWriter added in v0.6.0

type BulkIngestWriter struct {
	*Writer
	// contains filtered or unexported fields
}

BulkIngestWriter is a WAL processor implementation that batches and bulk writes wal insert events to a Postgres instance using the COPY command.

func NewBulkIngestWriter added in v0.6.0

func NewBulkIngestWriter(ctx context.Context, config *Config, opts ...WriterOption) (*BulkIngestWriter, error)

NewBulkIngestWriter returns a postgres processor that batches and writes data to the configured postgres instance in bulk using the COPY command. It uses a batch sender per schema table to parallelise the bulk ingest for different tables.

func (*BulkIngestWriter) Close added in v0.6.0

func (w *BulkIngestWriter) Close() error

func (*BulkIngestWriter) Name added in v0.6.0

func (w *BulkIngestWriter) Name() string

func (*BulkIngestWriter) ProcessWALEvent added in v0.6.0

func (w *BulkIngestWriter) 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
	BulkIngestEnabled bool
	RetryPolicy       backoff.Config
	IgnoreDDL         bool
}

type Writer added in v0.6.0

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

type WriterOption added in v0.6.0

type WriterOption func(*Writer)

func WithCheckpoint

func WithCheckpoint(c checkpointer.Checkpoint) WriterOption

func WithInstrumentation added in v0.6.0

func WithInstrumentation(i *otel.Instrumentation) WriterOption

func WithLogger

func WithLogger(l loglib.Logger) WriterOption

Jump to

Keyboard shortcuts

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