Documentation
¶
Index ¶
- Constants
- func MakeIncludeOptions(initialFlags *pflag.FlagSet, testTableName string)
- type DbSchema
- type DbTable
- type Option
- func (o Option) ContainsMetadata(metadataOnly, dataOnly bool) bool
- func (o Option) GetConnectionMode() string
- func (o Option) GetCopyMode() string
- func (o Option) GetDestDbnames() []string
- func (o Option) GetDestSchemas() []*DbSchema
- func (o Option) GetDestTables() []*DbTable
- func (o Option) GetDestTablesByDb(dbname string) []Table
- func (o Option) GetExclTablesByDb(dbname string) []Table
- func (o Option) GetIncludePartTablesByDb(dbname string) []Table
- func (o Option) GetIncludeTablesByDb(dbname string) []Table
- func (o Option) GetOwnerMap() map[string]string
- func (o Option) GetSchemaMap() map[string]string
- func (o Option) GetSourceDbnames() []string
- func (o Option) GetSourceSchemas() []*DbSchema
- func (o Option) GetTableMode() string
- func (o Option) GetTablespaceMap() map[string]string
- func (o Option) GetTblDestDbnames() []string
- func (o Option) GetTblSourceDbnames() []string
- func (o Option) IsBaseTableMode() bool
- func (o *Option) IsDestTableExisting(destDbName, destSchema, destName string) bool
- func (o *Option) MarkDestTables(dbname string, userTables map[string]TableStatistics, ...)
- func (o Option) MarkExcludeTables(dbname string, userTables map[string]TableStatistics, ...)
- func (o Option) MarkIncludeTables(dbname string, userTables map[string]TableStatistics, ...)
- func (o *Option) TranslateToDestFQN(srcSchema, srcName string) (string, string)
- func (o Option) ValidateDestTables(userTables map[string]TableStatistics, dbname string)
- func (o Option) ValidateExcludeTables(userTables map[string]TableStatistics, dbname string)
- func (o Option) ValidateIncludeTables(userTables map[string]TableStatistics, dbname string)
- type Table
- type TablePair
- type TableStatistics
Constants ¶
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" )
const ( CopyModeFull = "full" CopyModeDb = "db" CopyModeSchema = "schema" CopyModeTable = "table" )
const ( ConnectionModePush = "push" ConnectionModePull = "pull" )
const ( CompressTypeGzip = "gzip" CompressTypeSnappy = "snappy" CompressTypeZstd = "zstd" )
const ( TableModeTruncate = "truncate" TableModeAppend = "append" TableModeSkipExisting = "skip-existing" )
Variables ¶
This section is empty.
Functions ¶
func MakeIncludeOptions ¶
Types ¶
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
func (Option) ContainsMetadata ¶
func (Option) GetConnectionMode ¶
func (Option) GetCopyMode ¶
func (Option) GetDestDbnames ¶
func (Option) GetDestSchemas ¶
func (Option) GetDestTables ¶
func (Option) GetDestTablesByDb ¶
func (Option) GetExclTablesByDb ¶
func (Option) GetIncludePartTablesByDb ¶
func (Option) GetIncludeTablesByDb ¶
func (Option) GetOwnerMap ¶
func (Option) GetSchemaMap ¶
func (Option) GetSourceDbnames ¶
func (Option) GetSourceSchemas ¶
func (Option) GetTableMode ¶
func (Option) GetTablespaceMap ¶
func (Option) GetTblDestDbnames ¶
func (Option) GetTblSourceDbnames ¶
func (Option) IsBaseTableMode ¶
func (*Option) IsDestTableExisting ¶ added in v1.1.6
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 (Option) MarkExcludeTables ¶
func (Option) MarkIncludeTables ¶
func (*Option) TranslateToDestFQN ¶ added in v1.1.6
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)