MCPcopy Create free account
hub / github.com/Shopify/ghostferry / TargetToSourceRewrites

Function TargetToSourceRewrites

table_schema_cache.go:337–348  ·  view source on GitHub ↗
(databaseRewrites map[string]string)

Source from the content-addressed store, hash-verified

335}
336
337func TargetToSourceRewrites(databaseRewrites map[string]string) (map[string]string, error) {
338 targetToSourceRewrites := make(map[string]string)
339
340 for sourceVal, targetVal := range databaseRewrites {
341 if _, exists := targetToSourceRewrites[targetVal]; exists {
342 return nil, errors.New("duplicate target to source rewrite detected")
343 }
344 targetToSourceRewrites[targetVal] = sourceVal
345 }
346
347 return targetToSourceRewrites, nil
348}
349
350// Helper to sort a given map of tables with a second list giving a priority.
351// If an element is present in the input and the priority lists, the item will

Calls

no outgoing calls