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: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Postgres connection URL. Required.
	URL string
	// BatchBytes represents the size of the batch of table pages in bytes.
	// Defaults to 80MiB.
	BatchBytes uint64
	// SnapshotWorkers represents the number of snapshots the generator will
	// process concurrently. This doesn't affect the parallelism of the tables
	// within each individual snapshot request. It defaults to 1.
	SnapshotWorkers uint
	// SchemaWorkers represents the number of tables the snapshot generator will
	// process concurrently per schema. Defaults to 4.
	SchemaWorkers uint
	// TableWorkers represents the number of concurrent workers per table. Each
	// worker will process a different page range in parallel. Defaults to 4.
	TableWorkers uint
	// MaxConnections represents the maximum number of connections that the
	// snapshot generator can open to Postgres. This setting is optional.
	// Defaults to 50
	MaxConnections uint
}

type Option

type Option func(sg *SnapshotGenerator)

func WithInstrumentation added in v0.6.0

func WithInstrumentation(i *otel.Instrumentation) Option

func WithLogger

func WithLogger(logger loglib.Logger) Option

func WithProgressTracking added in v0.6.6

func WithProgressTracking() Option

type SnapshotGenerator

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

func NewSnapshotGenerator

func NewSnapshotGenerator(ctx context.Context, cfg *Config, processor processor.Processor, opts ...Option) (*SnapshotGenerator, error)

func (*SnapshotGenerator) Close

func (sg *SnapshotGenerator) Close() error

func (*SnapshotGenerator) CreateSnapshot

func (sg *SnapshotGenerator) CreateSnapshot(ctx context.Context, ss *snapshot.Snapshot) (err error)

Jump to

Keyboard shortcuts

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