Documentation
¶
Index ¶
- func CheckDiffFileFormat(filePath string, task *TableDiffTask) error
- func RepsetDiff(task *RepsetDiffCmd) (err error)
- type DiffSummary
- type FailedTableInfo
- type HashResult
- type HashTask
- type MissingTableInfo
- type NodeComparisonReport
- type NodeDiff
- type NodeSchemaReport
- type Range
- type RangeResults
- type RecursiveDiffTask
- type RepsetDiffCmd
- func (task *RepsetDiffCmd) CloneForSchedule(ctx context.Context) *RepsetDiffCmd
- func (c *RepsetDiffCmd) GetClusterName() string
- func (c *RepsetDiffCmd) GetClusterNodes() []map[string]any
- func (c *RepsetDiffCmd) GetDBName() string
- func (c *RepsetDiffCmd) GetNodeList() []string
- func (c *RepsetDiffCmd) GetNodes() string
- func (c *RepsetDiffCmd) RunChecks(skipValidation bool) error
- func (c *RepsetDiffCmd) SetClusterNodes(cn []map[string]any)
- func (c *RepsetDiffCmd) SetDBName(name string)
- func (c *RepsetDiffCmd) SetDatabase(db types.Database)
- func (c *RepsetDiffCmd) SetNodeList(nodes []string)
- func (c *RepsetDiffCmd) Validate() error
- type SchemaDiffCmd
- func (task *SchemaDiffCmd) CloneForSchedule(ctx context.Context) *SchemaDiffCmd
- func (c *SchemaDiffCmd) GetClusterName() string
- func (c *SchemaDiffCmd) GetClusterNodes() []map[string]any
- func (c *SchemaDiffCmd) GetDBName() string
- func (c *SchemaDiffCmd) GetNodeList() []string
- func (c *SchemaDiffCmd) GetNodes() string
- func (c *SchemaDiffCmd) RunChecks(skipValidation bool) error
- func (task *SchemaDiffCmd) SchemaTableDiff() (err error)
- func (c *SchemaDiffCmd) SetClusterNodes(cn []map[string]any)
- func (c *SchemaDiffCmd) SetDBName(name string)
- func (c *SchemaDiffCmd) SetDatabase(db types.Database)
- func (c *SchemaDiffCmd) SetNodeList(nodes []string)
- func (c *SchemaDiffCmd) Validate() error
- type SchemaObjects
- type SpockDiffTask
- func (t *SpockDiffTask) ExecuteTask() (err error)
- func (t *SpockDiffTask) GetClusterName() string
- func (t *SpockDiffTask) GetClusterNodes() []map[string]any
- func (t *SpockDiffTask) GetDBName() string
- func (t *SpockDiffTask) GetNodeList() []string
- func (t *SpockDiffTask) GetNodes() string
- func (t *SpockDiffTask) RunChecks(skipValidation bool) error
- func (t *SpockDiffTask) SetClusterNodes(cn []map[string]any)
- func (t *SpockDiffTask) SetDBName(name string)
- func (t *SpockDiffTask) SetDatabase(db types.Database)
- func (t *SpockDiffTask) SetNodeList(nl []string)
- func (t *SpockDiffTask) Validate() error
- type SpockNodeConfig
- type TableDiffTask
- func (t *TableDiffTask) AddPrimaryKeyToDiffSummary()
- func (t *TableDiffTask) CheckColumnSize() error
- func (t *TableDiffTask) CloneForSchedule(ctx context.Context) *TableDiffTask
- func (t *TableDiffTask) ExecuteRerunTask() error
- func (t *TableDiffTask) ExecuteTask() (err error)
- func (t *TableDiffTask) GetClusterName() string
- func (t *TableDiffTask) GetClusterNodes() []map[string]any
- func (t *TableDiffTask) GetDBName() string
- func (t *TableDiffTask) GetNodeList() []string
- func (t *TableDiffTask) GetNodes() string
- func (t *TableDiffTask) RunChecks(skipValidation bool) (err error)
- func (t *TableDiffTask) SetClusterNodes(cn []map[string]any)
- func (t *TableDiffTask) SetDBName(name string)
- func (t *TableDiffTask) SetDatabase(db types.Database)
- func (t *TableDiffTask) SetNodeList(nl []string)
- func (t *TableDiffTask) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDiffFileFormat ¶
func CheckDiffFileFormat(filePath string, task *TableDiffTask) error
func RepsetDiff ¶
func RepsetDiff(task *RepsetDiffCmd) (err error)
Types ¶
type DiffSummary ¶ added in v1.7.1
type DiffSummary struct {
MatchedTables []string
DifferedTables []string
FailedTables []FailedTableInfo
MissingTables []MissingTableInfo
SkippedTables []string
}
DiffSummary collects per-table outcomes during a schema-diff or repset-diff run and prints a human-readable summary at the end.
func (*DiffSummary) PrintAndFinalize ¶ added in v1.7.1
func (s *DiffSummary) PrintAndFinalize(commandName, label string) error
PrintAndFinalize logs the summary and returns an error if any tables failed. The label identifies the scope (e.g. "schema public" or "repset default").
type FailedTableInfo ¶ added in v1.7.1
type FailedTableInfo struct {
Table string // schema-qualified table name
Err error // the error that caused the failure
}
FailedTableInfo records a table whose diff failed along with the reason.
type HashResult ¶
type HashResult struct {
// contains filtered or unexported fields
}
type MissingTableInfo ¶ added in v1.7.1
type MissingTableInfo struct {
Table string // schema-qualified table name
PresentOn []string // node names where the table exists
MissingFrom []string // node names where the table does not exist
}
MissingTableInfo records a table that was not found on every node.
type NodeComparisonReport ¶
type NodeDiff ¶
type NodeDiff struct {
MissingObjects SchemaObjects `json:"missing_objects"`
ExtraObjects SchemaObjects `json:"extra_objects"`
}
type NodeSchemaReport ¶
type NodeSchemaReport struct {
NodeName string `json:"node_name"`
Objects SchemaObjects `json:"objects"`
}
type RangeResults ¶
type RangeResults map[string]HashResult
type RecursiveDiffTask ¶
type RepsetDiffCmd ¶
type RepsetDiffCmd struct {
types.Task
ClusterName string
DBName string
RepsetName string
Nodes string
Quiet bool
SkipTables string
SkipFile string
ConnectionPool *pgxpool.Pool
ConcurrencyFactor float64
MaxConnections int
BlockSize int
CompareUnitSize int
Output string
TableFilter string
OverrideBlockSize bool
Ctx context.Context
ClientRole string
InvokeMethod string
SkipDBUpdate bool
TaskStore *taskstore.Store
TaskStorePath string
// contains filtered or unexported fields
}
func NewRepsetDiffTask ¶
func NewRepsetDiffTask() *RepsetDiffCmd
func (*RepsetDiffCmd) CloneForSchedule ¶
func (task *RepsetDiffCmd) CloneForSchedule(ctx context.Context) *RepsetDiffCmd
func (*RepsetDiffCmd) GetClusterName ¶
func (c *RepsetDiffCmd) GetClusterName() string
func (*RepsetDiffCmd) GetClusterNodes ¶
func (c *RepsetDiffCmd) GetClusterNodes() []map[string]any
func (*RepsetDiffCmd) GetDBName ¶
func (c *RepsetDiffCmd) GetDBName() string
func (*RepsetDiffCmd) GetNodeList ¶
func (c *RepsetDiffCmd) GetNodeList() []string
func (*RepsetDiffCmd) GetNodes ¶
func (c *RepsetDiffCmd) GetNodes() string
func (*RepsetDiffCmd) RunChecks ¶
func (c *RepsetDiffCmd) RunChecks(skipValidation bool) error
func (*RepsetDiffCmd) SetClusterNodes ¶
func (c *RepsetDiffCmd) SetClusterNodes(cn []map[string]any)
func (*RepsetDiffCmd) SetDBName ¶
func (c *RepsetDiffCmd) SetDBName(name string)
func (*RepsetDiffCmd) SetDatabase ¶
func (c *RepsetDiffCmd) SetDatabase(db types.Database)
func (*RepsetDiffCmd) SetNodeList ¶
func (c *RepsetDiffCmd) SetNodeList(nodes []string)
func (*RepsetDiffCmd) Validate ¶
func (c *RepsetDiffCmd) Validate() error
type SchemaDiffCmd ¶
type SchemaDiffCmd struct {
types.Task
ClusterName string
DBName string
SchemaName string
Nodes string
Quiet bool
SkipTables string
SkipFile string
DDLOnly bool
ConnectionPool *pgxpool.Pool
ConcurrencyFactor float64
MaxConnections int
BlockSize int
CompareUnitSize int
Output string
TableFilter string
OverrideBlockSize bool
Ctx context.Context
SkipDBUpdate bool
TaskStore *taskstore.Store
TaskStorePath string
// contains filtered or unexported fields
}
func NewSchemaDiffTask ¶
func NewSchemaDiffTask() *SchemaDiffCmd
func (*SchemaDiffCmd) CloneForSchedule ¶
func (task *SchemaDiffCmd) CloneForSchedule(ctx context.Context) *SchemaDiffCmd
func (*SchemaDiffCmd) GetClusterName ¶
func (c *SchemaDiffCmd) GetClusterName() string
func (*SchemaDiffCmd) GetClusterNodes ¶
func (c *SchemaDiffCmd) GetClusterNodes() []map[string]any
func (*SchemaDiffCmd) GetDBName ¶
func (c *SchemaDiffCmd) GetDBName() string
func (*SchemaDiffCmd) GetNodeList ¶
func (c *SchemaDiffCmd) GetNodeList() []string
func (*SchemaDiffCmd) GetNodes ¶
func (c *SchemaDiffCmd) GetNodes() string
func (*SchemaDiffCmd) RunChecks ¶
func (c *SchemaDiffCmd) RunChecks(skipValidation bool) error
func (*SchemaDiffCmd) SchemaTableDiff ¶
func (task *SchemaDiffCmd) SchemaTableDiff() (err error)
func (*SchemaDiffCmd) SetClusterNodes ¶
func (c *SchemaDiffCmd) SetClusterNodes(cn []map[string]any)
func (*SchemaDiffCmd) SetDBName ¶
func (c *SchemaDiffCmd) SetDBName(name string)
func (*SchemaDiffCmd) SetDatabase ¶
func (c *SchemaDiffCmd) SetDatabase(db types.Database)
func (*SchemaDiffCmd) SetNodeList ¶
func (c *SchemaDiffCmd) SetNodeList(nodes []string)
func (*SchemaDiffCmd) Validate ¶
func (c *SchemaDiffCmd) Validate() error
type SchemaObjects ¶
type SchemaObjects struct {
Tables []string `json:"tables"`
Views []string `json:"views"`
Functions []string `json:"functions"`
Indices []string `json:"indices"`
}
func (SchemaObjects) IsEmpty ¶
func (so SchemaObjects) IsEmpty() bool
type SpockDiffTask ¶
type SpockDiffTask struct {
types.Task
types.DerivedFields
DBName string
Nodes string
Output string
ClientRole string
InvokeMethod string
Pools map[string]*pgxpool.Pool
DiffResult *types.SpockDiffOutput
DiffFilePath string
SkipDBUpdate bool
TaskStore *taskstore.Store
TaskStorePath string
Ctx context.Context
}
SpockDiffTask defines the task for comparing spock metadata across nodes.
func NewSpockDiffTask ¶
func NewSpockDiffTask() *SpockDiffTask
func (*SpockDiffTask) ExecuteTask ¶
func (t *SpockDiffTask) ExecuteTask() (err error)
func (*SpockDiffTask) GetClusterName ¶
func (t *SpockDiffTask) GetClusterName() string
Implement ClusterConfigProvider interface for SpockDiffTask
func (*SpockDiffTask) GetClusterNodes ¶
func (t *SpockDiffTask) GetClusterNodes() []map[string]any
func (*SpockDiffTask) GetDBName ¶
func (t *SpockDiffTask) GetDBName() string
func (*SpockDiffTask) GetNodeList ¶
func (t *SpockDiffTask) GetNodeList() []string
func (*SpockDiffTask) GetNodes ¶
func (t *SpockDiffTask) GetNodes() string
func (*SpockDiffTask) RunChecks ¶
func (t *SpockDiffTask) RunChecks(skipValidation bool) error
func (*SpockDiffTask) SetClusterNodes ¶
func (t *SpockDiffTask) SetClusterNodes(cn []map[string]any)
func (*SpockDiffTask) SetDBName ¶
func (t *SpockDiffTask) SetDBName(name string)
func (*SpockDiffTask) SetDatabase ¶
func (t *SpockDiffTask) SetDatabase(db types.Database)
func (*SpockDiffTask) SetNodeList ¶
func (t *SpockDiffTask) SetNodeList(nl []string)
func (*SpockDiffTask) Validate ¶
func (t *SpockDiffTask) Validate() error
type SpockNodeConfig ¶
type SpockNodeConfig struct {
NodeName string `json:"node_name"`
Subscriptions []types.SpockSubscription `json:"subscriptions"`
RepSetInfo []types.SpockRepSetInfo `json:"rep_set_info"`
Hints []string `json:"hints"`
}
SpockNodeConfig aggregates all spock configuration for a single node.
type TableDiffTask ¶
type TableDiffTask struct {
types.Task
types.DerivedFields
QualifiedTableName string
DBName string
Nodes string
BaseTable string
FilteredViewName string
FilteredViewCreated bool
BlockSize int
ConcurrencyFactor float64
MaxConnections int
Output string
TableFilter string
QuietMode bool
AgainstOrigin string
Until string
EffectiveFilter string
Mode string
OverrideBlockSize bool
DiffFilePath string
InvokeMethod string
ClientRole string
EnsurePgcrypto bool
DiffSummary map[string]string
SkipDBUpdate bool
TaskStore *taskstore.Store
TaskStorePath string
Pools map[string]*pgxpool.Pool
SpockNodeNames map[string]string
CompareUnitSize int
MaxDiffRows int64
DiffResult types.DiffOutput
Ctx context.Context
// contains filtered or unexported fields
}
func NewTableDiffTask ¶
func NewTableDiffTask() *TableDiffTask
func (*TableDiffTask) AddPrimaryKeyToDiffSummary ¶
func (t *TableDiffTask) AddPrimaryKeyToDiffSummary()
func (*TableDiffTask) CheckColumnSize ¶
func (t *TableDiffTask) CheckColumnSize() error
func (*TableDiffTask) CloneForSchedule ¶
func (t *TableDiffTask) CloneForSchedule(ctx context.Context) *TableDiffTask
func (*TableDiffTask) ExecuteRerunTask ¶
func (t *TableDiffTask) ExecuteRerunTask() error
func (*TableDiffTask) ExecuteTask ¶
func (t *TableDiffTask) ExecuteTask() (err error)
func (*TableDiffTask) GetClusterName ¶
func (t *TableDiffTask) GetClusterName() string
Implement ClusterConfigProvider interface for TableDiffTask
func (*TableDiffTask) GetClusterNodes ¶
func (t *TableDiffTask) GetClusterNodes() []map[string]any
func (*TableDiffTask) GetDBName ¶
func (t *TableDiffTask) GetDBName() string
func (*TableDiffTask) GetNodeList ¶
func (t *TableDiffTask) GetNodeList() []string
func (*TableDiffTask) GetNodes ¶
func (t *TableDiffTask) GetNodes() string
func (*TableDiffTask) RunChecks ¶
func (t *TableDiffTask) RunChecks(skipValidation bool) (err error)
func (*TableDiffTask) SetClusterNodes ¶
func (t *TableDiffTask) SetClusterNodes(cn []map[string]any)
func (*TableDiffTask) SetDBName ¶
func (t *TableDiffTask) SetDBName(name string)
func (*TableDiffTask) SetDatabase ¶
func (t *TableDiffTask) SetDatabase(db types.Database)
func (*TableDiffTask) SetNodeList ¶
func (t *TableDiffTask) SetNodeList(nl []string)
func (*TableDiffTask) Validate ¶
func (t *TableDiffTask) Validate() error