MCPcopy Create free account
hub / github.com/apecloud/myduckserver / SimpleStrReplacement

Function SimpleStrReplacement

pgserver/stmt.go:346–350  ·  view source on GitHub ↗

This function will replace all type casts in the query with the corresponding type cast in the simpleStringsConversion map.

(sql string)

Source from the content-addressed store, hash-verified

344 }
345 simpleStrMatchingRegex = regexp.MustCompile(`(?i)(` + strings.Join(simpleStrings, "|") + `)`)
346 })
347 return simpleStrMatchingRegex
348}
349
350// This function will replace all type casts in the query with the corresponding type cast in the simpleStringsConversion map.
351func SimpleStrReplacement(sql string) string {
352 return getSimpleStringMatchingRegex().ReplaceAllStringFunc(sql, func(m string) string {
353 return simpleStringsConversion[strings.ToLower(m)]

Callers 1

Calls 1

Tested by

no test coverage detected