pgdump

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptRegexp

func AdaptRegexp(data string) (string, error)

Types

type Options

type Options struct {
	// General options:
	FileName        string `mapstructure:"file"` // --file=FILENAME
	Format          string // Supports only directory format
	Jobs            int    `mapstructure:"jobs"`
	Verbose         bool   `mapstructure:"verbose"`
	Compression     int    `mapstructure:"compress"`
	LockWaitTimeout int    `mapstructure:"lock-wait-timeout"`
	NoSync          bool   `mapstructure:"no-sync"`

	// Options controlling the output content
	DataOnly                   bool     `mapstructure:"data-only"`
	Blobs                      bool     `mapstructure:"blobs"`
	NoBlobs                    bool     `mapstructure:"no-blobs"`
	Clean                      bool     `mapstructure:"clean"`
	Create                     bool     `mapstructure:"create"`
	Extension                  []string `mapstructure:"extension"`
	Encoding                   string   `mapstructure:"encoding"`
	Schema                     []string `mapstructure:"schema"`
	ExcludeSchema              []string `mapstructure:"exclude-schema"`
	NoOwner                    bool     `mapstructure:"no-owner"`
	SchemaOnly                 bool     `mapstructure:"schema-only"`
	Table                      []string `mapstructure:"table"`
	ExcludeTable               []string `mapstructure:"exclude-table"`
	NoPrivileges               bool     `mapstructure:"no-privileges"`
	DisableDollarQuoting       bool     `mapstructure:"disable-dollar-quoting"`
	EnableRowSecurity          bool     `mapstructure:"enable-row-security"`
	ExcludeTableData           []string `mapstructure:"exclude-table-data"`
	ExtraFloatDigits           string   `mapstructure:"extra-float-digits"`
	IfExists                   bool     `mapstructure:"if-exists"`
	IncludeForeignData         []string `mapstructure:"include-foreign-data"`
	LoadViaPartitionRoot       bool     `mapstructure:"load-via-partition-root"`
	NoComments                 bool     `mapstructure:"no-comments"`
	NoPublications             bool     `mapstructure:"no-publications"`
	NoSecurityLabels           bool     `mapstructure:"no-security-labels"`
	NoSubscriptions            bool     `mapstructure:"no-subscriptions"`
	NoSynchronizedSnapshots    bool     `mapstructure:"no-synchronized-snapshots"`
	NoTableSpaces              bool     `mapstructure:"no-tablespaces"`
	NoToastCompression         bool     `mapstructure:"no-toast-compression"`
	NoUnloggedTableData        bool     `mapstructure:"no-unlogged-table-data"`
	QuoteAllIdentifiers        bool     `mapstructure:"quote-all-identifiers"`
	Section                    string   `mapstructure:"section"`
	SerializableDeferrable     bool     `mapstructure:"serializable-deferrable"`
	Snapshot                   string   `mapstructure:"snapshot"`
	StrictNames                bool     `mapstructure:"strict-names"`
	UseSetSessionAuthorization bool     `mapstructure:"use-set-session-authorization"`

	// Custom options (not from pg_dump)
	// Use pgzip compression instead of gzip
	Pgzip bool `mapstructure:"pgzip"`

	// Connection options:
	DbName     string `mapstructure:"dbname"`
	Host       string `mapstructure:"host"`
	Port       int    `mapstructure:"port"`
	UserName   string `mapstructure:"username"`
	NoPassword bool   `mapstructure:"no-password"`
	Password   bool   `mapstructure:"password"`
	Role       string `mapstructure:"role"`
}

func (*Options) GetParams

func (o *Options) GetParams() []string

func (*Options) GetPgDSN

func (o *Options) GetPgDSN() (string, error)

type ParserContext

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

func (*ParserContext) Depth

func (p *ParserContext) Depth() int

type PgDump

type PgDump struct {
	BinPath string
}

func NewPgDump

func NewPgDump(binPath string) *PgDump

func (*PgDump) Run

func (pd *PgDump) Run(ctx context.Context, options *Options) error

Jump to

Keyboard shortcuts

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