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

Function stringConstValue

transpiler/transform/literals.go:63–75  ·  view source on GitHub ↗

stringConstValue returns the string value of an A_Const string literal.

(node *pg_query.Node)

Source from the content-addressed store, hash-verified

61
62// stringConstValue returns the string value of an A_Const string literal.
63func stringConstValue(node *pg_query.Node) (string, bool) {
64 if node == nil {
65 return "", false
66 }
67 ac := node.GetAConst()
68 if ac == nil {
69 return "", false
70 }
71 if sv := ac.GetSval(); sv != nil {
72 return sv.Sval, true
73 }
74 return "", false
75}
76
77// hasHexPrefix reports whether a string uses Postgres bytea hex format (\x...).
78func hasHexPrefix(s string) bool {

Callers 1

TransformMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected