MCPcopy
hub / github.com/sqldef/sqldef / Format

Method Format

parser/node.go:2479–2497  ·  view source on GitHub ↗

Format formats the node.

(buf *nodeBuffer)

Source from the content-addressed store, hash-verified

2477
2478// Format formats the node.
2479func (node *FuncExpr) Format(buf *nodeBuffer) {
2480 var distinct string
2481 if node.Distinct {
2482 distinct = "distinct "
2483 }
2484 if !node.Qualifier.IsEmpty() {
2485 buf.Printf("%v.", node.Qualifier)
2486 }
2487 // Function names should not be back-quoted even
2488 // if they match a reserved word. So, print the
2489 // name as is.
2490 buf.Printf("%s(%s%v)", node.Name.Name, distinct, node.Exprs)
2491 if len(node.WithinGroup) > 0 {
2492 buf.Printf(" within group(")
2493 node.WithinGroup.Format(buf)
2494 buf.Printf(")")
2495 }
2496 buf.Printf("%v", node.Over)
2497}
2498
2499// FuncCallExpr represents a function call that takes Exprs.
2500type FuncCallExpr struct {

Callers

nothing calls this directly

Calls 3

PrintfMethod · 0.65
FormatMethod · 0.65
IsEmptyMethod · 0.45

Tested by

no test coverage detected