MCPcopy Create free account
hub / github.com/bytebase/bytebase / normalizeTriggerBody

Function normalizeTriggerBody

backend/plugin/schema/differ.go:1448–1465  ·  view source on GitHub ↗

normalizeTriggerBody normalizes trigger body for comparison

(body string)

Source from the content-addressed store, hash-verified

1446
1447// normalizeTriggerBody normalizes trigger body for comparison
1448func normalizeTriggerBody(body string) string {
1449 if body == "" {
1450 return ""
1451 }
1452
1453 // Aggressive normalization: remove ALL whitespace for comparison
1454 // This handles cases where ANTLR GetText() strips whitespace
1455 normalized := strings.ReplaceAll(body, " ", "")
1456 normalized = strings.ReplaceAll(normalized, "\r\n", "")
1457 normalized = strings.ReplaceAll(normalized, "\r", "")
1458 normalized = strings.ReplaceAll(normalized, "\n", "")
1459 normalized = strings.ReplaceAll(normalized, "\t", "")
1460
1461 // Convert to uppercase for case-insensitive comparison
1462 normalized = strings.ToUpper(normalized)
1463
1464 return normalized
1465}
1466
1467// partitionsEqual checks if two partitions are equal.
1468func partitionsEqual(engine storepb.Engine, part1, part2 *storepb.TablePartitionMetadata) bool {

Callers 1

triggersEqualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected