option

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APPEND                  = "append"
	DBNAME                  = "dbname"
	DEBUG                   = "debug"
	DEST_DBNAME             = "dest-dbname"
	DEST_HOST               = "dest-host"
	DEST_PORT               = "dest-port"
	DEST_TABLE              = "dest-table"
	DEST_TABLE_FILE         = "dest-table-file"
	DEST_USER               = "dest-user"
	EXCLUDE_TABLE           = "exclude-table"
	EXCLUDE_TABLE_FILE      = "exclude-table-file"
	FULL                    = "full"
	INCLUDE_TABLE           = "include-table"
	INCLUDE_TABLE_FILE      = "include-table-file"
	COPY_JOBS               = "copy-jobs"
	METADATA_JOBS           = "metadata-jobs"
	METADATA_ONLY           = "metadata-only"
	GLOBAL_METADATA_ONLY    = "global-metadata-only"
	DATA_ONLY               = "data-only"
	WITH_GLOBAL_METADATA    = "with-global-metadata"
	COMPRESSION             = "compression"
	COMPRESS_TYPE           = "compress-type"
	ON_SEGMENT_THRESHOLD    = "on-segment-threshold"
	QUIET                   = "quiet"
	SOURCE_HOST             = "source-host"
	SOURCE_PORT             = "source-port"
	SOURCE_USER             = "source-user"
	SKIP_EXISTING           = "skip-existing"
	TRUNCATE                = "truncate"
	VALIDATE                = "validate"
	SCHEMA                  = "schema"
	EXCLUDE_SCHEMA          = "exclude-schema" // test purpose, to reuse gpbackup integration test case
	DEST_SCHEMA             = "dest-schema"
	SCHEMA_MAPPING_FILE     = "schema-mapping-file"
	OWNER_MAPPING_FILE      = "owner-mapping-file"
	DEST_TABLESPACE         = "dest-tablespace"
	TABLESPACE_MAPPING_FILE = "tablespace-mapping-file"
	VERBOSE                 = "verbose"
	DATA_PORT_RANGE         = "data-port-range"
	CONNECTION_MODE         = "connection-mode"
)
View Source
const (
	CopyModeFull   = "full"
	CopyModeDb     = "db"
	CopyModeSchema = "schema"
	CopyModeTable  = "table"
)
View Source
const (
	ConnectionModePush = "push"
	ConnectionModePull = "pull"
)
View Source
const (
	CompressTypeGzip   = "gzip"
	CompressTypeSnappy = "snappy"
	CompressTypeZstd   = "zstd"
)
View Source
const (
	TableModeTruncate     = "truncate"
	TableModeAppend       = "append"
	TableModeSkipExisting = "skip-existing"
)

Variables

This section is empty.

Functions

func MakeIncludeOptions

func MakeIncludeOptions(initialFlags *pflag.FlagSet, testTableName string)

Types

type DbSchema

type DbSchema struct {
	Database string
	Schema   string
}

type DbTable

type DbTable struct {
	Database string
	Table
}

type Option

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

func NewOption

func NewOption(initialFlags *pflag.FlagSet) (*Option, error)

func (Option) ContainsMetadata

func (o Option) ContainsMetadata(metadataOnly, dataOnly bool) bool

func (Option) GetConnectionMode

func (o Option) GetConnectionMode() string

func (Option) GetCopyMode

func (o Option) GetCopyMode() string

func (Option) GetDestDbnames

func (o Option) GetDestDbnames() []string

func (Option) GetDestSchemas

func (o Option) GetDestSchemas() []*DbSchema

func (Option) GetDestTables

func (o Option) GetDestTables() []*DbTable

func (Option) GetDestTablesByDb

func (o Option) GetDestTablesByDb(dbname string) []Table

func (Option) GetExclTablesByDb

func (o Option) GetExclTablesByDb(dbname string) []Table

func (Option) GetIncludePartTablesByDb

func (o Option) GetIncludePartTablesByDb(dbname string) []Table

func (Option) GetIncludeTablesByDb

func (o Option) GetIncludeTablesByDb(dbname string) []Table

func (Option) GetOwnerMap

func (o Option) GetOwnerMap() map[string]string

func (Option) GetSchemaMap

func (o Option) GetSchemaMap() map[string]string

func (Option) GetSourceDbnames

func (o Option) GetSourceDbnames() []string

func (Option) GetSourceSchemas

func (o Option) GetSourceSchemas() []*DbSchema

func (Option) GetTableMode

func (o Option) GetTableMode() string

func (Option) GetTablespaceMap

func (o Option) GetTablespaceMap() map[string]string

func (Option) GetTblDestDbnames

func (o Option) GetTblDestDbnames() []string

func (Option) GetTblSourceDbnames

func (o Option) GetTblSourceDbnames() []string

func (Option) IsBaseTableMode

func (o Option) IsBaseTableMode() bool

func (*Option) IsDestTableExisting added in v1.1.6

func (o *Option) IsDestTableExisting(destDbName, destSchema, destName string) bool

IsDestTableExisting reports whether a table with the given (already schema-mapping-translated) destination schema and name is present in the destination database. The check is by fully-qualified name only; column definitions are not compared (matching gpcopy's --skip-existing semantics). Root-partition tables are also recognized, so this returns true for the root of a partition tree even if it was not listed in GetUserTables.

func (*Option) MarkDestTables

func (o *Option) MarkDestTables(dbname string, userTables map[string]TableStatistics, partTables map[string]bool)

func (Option) MarkExcludeTables

func (o Option) MarkExcludeTables(dbname string, userTables map[string]TableStatistics, partTables map[string]bool)

func (Option) MarkIncludeTables

func (o Option) MarkIncludeTables(dbname string, userTables map[string]TableStatistics, partTables map[string]bool)

func (*Option) TranslateToDestFQN added in v1.1.6

func (o *Option) TranslateToDestFQN(srcSchema, srcName string) (string, string)

TranslateToDestFQN converts a source-side (schema, name) pair into the corresponding destination-side pair after applying --schema-mapping rules. If no mapping applies (e.g., db-mode or full-mode without --schema-mapping), the source schema is returned unchanged, mirroring cbcopy's default of "same schema on both sides".

func (Option) ValidateDestTables

func (o Option) ValidateDestTables(userTables map[string]TableStatistics, dbname string)

func (Option) ValidateExcludeTables

func (o Option) ValidateExcludeTables(userTables map[string]TableStatistics, dbname string)

func (Option) ValidateIncludeTables

func (o Option) ValidateIncludeTables(userTables map[string]TableStatistics, dbname string)

type Table

type Table struct {
	Schema       string
	Name         string
	Partition    int
	RelTuples    int64
	IsReplicated bool
}

type TablePair

type TablePair struct {
	SrcTable  Table
	DestTable Table
}

type TableStatistics

type TableStatistics struct {
	Partition    int
	RelTuples    int64
	IsReplicated bool
}

Jump to

Keyboard shortcuts

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