Documentation
¶
Index ¶
- Constants
- func AddSpockMetadata(row map[string]any) map[string]any
- func ApplyDatabaseCredentials(dst map[string]any, db types.Database)
- func CheckClusterExists(clusterName string) bool
- func Contains(slice []string, value string) bool
- func ConvertToPgxType(val any, pgType string) (any, error)
- func DiffStringSlices(a, b []string) (missing, extra []string)
- func IsKnownScalarType(colType string) bool
- func MapToOrderedMap(m map[string]any, cols []string) types.OrderedMap
- func OrderedMapToMap(om types.OrderedMap) map[string]any
- func ParseNodes(nodes any) ([]string, error)
- func ReadClusterInfo(t ClusterConfigProvider) error
- func SafeCut(s string, n int) string
- func StringifyKey(row map[string]any, pkeyCols []string) (string, error)
- func StringifyOrderedMapKey(row types.OrderedMap, pkeyCols []string) (string, error)
- func StripSpockMetadata(row map[string]any) map[string]any
- func TranslateNodeOrigin(raw any, nodeNames map[string]string) any
- func WriteDiffReport(diffResult types.DiffOutput, schema, table, format string) (string, string, error)
- type ClusterConfigProvider
- type DiffResult
- type ModifiedRow
Constants ¶
View Source
const ( CheckMark = "\u2714" CrossMark = "\u2718" )
Variables ¶
This section is empty.
Functions ¶
func ApplyDatabaseCredentials ¶ added in v1.4.0
ApplyDatabaseCredentials ensures the provided map has the database level connection details (user/password/ssl). Existing non-empty values are left untouched so node-specific overrides are preserved.
func CheckClusterExists ¶
func ConvertToPgxType ¶
ConvertToPgxType converts a value from a JSON unmarshal to a type that pgx can handle
func DiffStringSlices ¶
func IsKnownScalarType ¶
func MapToOrderedMap ¶
func MapToOrderedMap(m map[string]any, cols []string) types.OrderedMap
func OrderedMapToMap ¶
func OrderedMapToMap(om types.OrderedMap) map[string]any
func ParseNodes ¶
func ReadClusterInfo ¶
func ReadClusterInfo(t ClusterConfigProvider) error
func StringifyOrderedMapKey ¶
func StringifyOrderedMapKey(row types.OrderedMap, pkeyCols []string) (string, error)
func TranslateNodeOrigin ¶ added in v1.5.0
func WriteDiffReport ¶
Types ¶
type ClusterConfigProvider ¶
type DiffResult ¶
type DiffResult struct {
Node1OnlyRows []types.OrderedMap
Node2OnlyRows []types.OrderedMap
ModifiedRows []ModifiedRow
}
func CompareRowSets ¶
func CompareRowSets(rows1, rows2 []types.OrderedMap, pkeyCols []string, dataCols []string) (DiffResult, error)
type ModifiedRow ¶
type ModifiedRow struct {
PKey string
Node1Data types.OrderedMap
Node2Data types.OrderedMap
}
Click to show internal directories.
Click to hide internal directories.