pgdumprestore

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 16 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 {
	SourcePGURL    string
	TargetPGURL    string
	CleanTargetDB  bool
	CreateTargetDB bool
	// if set to true the snapshot will include all database objects, not tied
	// to any particular schema, such as extensions or triggers.
	IncludeGlobalDBObjects bool
	// Role name to be used to create the dump
	Role string
}

type Option

type Option func(s *SnapshotGenerator)

func WithInstrumentation added in v0.6.0

func WithInstrumentation(i *otel.Instrumentation) Option

func WithLogger

func WithLogger(logger loglib.Logger) Option

func WithSnapshotGenerator added in v0.6.0

func WithSnapshotGenerator(g generator.SnapshotGenerator) Option

type SnapshotGenerator

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

SnapshotGenerator generates postgres schema snapshots using pg_dump and pg_restore

func NewSnapshotGenerator

func NewSnapshotGenerator(ctx context.Context, c *Config, opts ...Option) (*SnapshotGenerator, error)

NewSnapshotGenerator will return a postgres schema snapshot generator that uses pg_dump and pg_restore to sync the schema of two postgres databases

func (*SnapshotGenerator) Close

func (s *SnapshotGenerator) Close() error

func (*SnapshotGenerator) CreateSnapshot

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

Jump to

Keyboard shortcuts

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