stringConstValue returns the string value of an A_Const string literal.
(node *pg_query.Node)
| 61 | |
| 62 | // stringConstValue returns the string value of an A_Const string literal. |
| 63 | func 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...). |
| 78 | func hasHexPrefix(s string) bool { |