extractStringConstant extracts the string value from an AST node if it's a string constant.
(node *pg_query.Node)
| 510 | |
| 511 | // extractStringConstant extracts the string value from an AST node if it's a string constant. |
| 512 | func extractStringConstant(node *pg_query.Node) string { |
| 513 | if node == nil { |
| 514 | return "" |
| 515 | } |
| 516 | if ac := node.GetAConst(); ac != nil { |
| 517 | if sval := ac.GetSval(); sval != nil { |
| 518 | return sval.Sval |
| 519 | } |
| 520 | } |
| 521 | return "" |
| 522 | } |
| 523 | |
| 524 | // setStringConstant sets the string value of an AST node that is a string constant. |
| 525 | func setStringConstant(node *pg_query.Node, value string) { |
no outgoing calls
no test coverage detected