MCPcopy Create free account
hub / github.com/PostHog/duckgres / setStringConstant

Function setStringConstant

transpiler/transform/functions.go:525–534  ·  view source on GitHub ↗

setStringConstant sets the string value of an AST node that is a string constant.

(node *pg_query.Node, value string)

Source from the content-addressed store, hash-verified

523
524// setStringConstant sets the string value of an AST node that is a string constant.
525func setStringConstant(node *pg_query.Node, value string) {
526 if node == nil {
527 return
528 }
529 if ac := node.GetAConst(); ac != nil {
530 if sval := ac.GetSval(); sval != nil {
531 sval.Sval = value
532 }
533 }
534}
535
536// isDateFormat checks if a PG format string is a date/time format (vs number format).
537func isDateFormat(format string) bool {

Callers 4

handleSpecialFunctionMethod · 0.85
handleToCharMethod · 0.85
handleToDateMethod · 0.85
handleToTimestampMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected