MCPcopy Create free account
hub / github.com/dolthub/doltgresql / inputExpressionForSelectExpr

Function inputExpressionForSelectExpr

server/ast/select.go:173–180  ·  view source on GitHub ↗

inputExpressionForSelectExpr returns the input expression for a tree.SelectExpr. Postgres has specific handling for function calls that differs from the default printing behavior.

(node tree.SelectExpr)

Source from the content-addressed store, hash-verified

171// inputExpressionForSelectExpr returns the input expression for a tree.SelectExpr.
172// Postgres has specific handling for function calls that differs from the default printing behavior.
173func inputExpressionForSelectExpr(node tree.SelectExpr) string {
174 inputExpression := tree.AsStringWithFlags(&node, tree.FmtOmitFunctionArgs)
175 // To be consistent with vitess handling, InputExpression always gets its outer quotes trimmed
176 if strings.HasPrefix(inputExpression, "'") && strings.HasSuffix(inputExpression, "'") {
177 inputExpression = inputExpression[1 : len(inputExpression)-1]
178 }
179 return inputExpression
180}
181
182// nodeSelectExprs handles tree.SelectExprs nodes.
183func nodeSelectExprs(ctx *Context, node tree.SelectExprs) (vitess.SelectExprs, error) {

Callers 1

nodeSelectExprFunction · 0.85

Calls 1

AsStringWithFlagsFunction · 0.92

Tested by

no test coverage detected