fix(spectypes): correct quoting logic in formatPostgresStringArray
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -33m2s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -28m38s
Build , Vet Test, and Lint / Lint Code (push) Successful in -27m26s
Build , Vet Test, and Lint / Build (push) Successful in -29m3s
Tests / Integration Tests (push) Failing after -33m9s
Tests / Unit Tests (push) Successful in -30m2s

This commit is contained in:
Hein
2026-04-30 15:38:21 +02:00
parent cc9c4337fd
commit fb051b5577

View File

@@ -66,7 +66,7 @@ func formatPostgresStringArray(vals []string) string {
parts := make([]string, len(vals))
for i, v := range vals {
// Quote if value contains comma, double-quote, backslash, braces, whitespace, or is empty.
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}` + "\t\n\r ")
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}`+"\t\n\r ")
if needsQuote {
v = strings.ReplaceAll(v, `\`, `\\`)
v = strings.ReplaceAll(v, `"`, `""`)