MCPcopy
hub / github.com/sqlc-dev/sqlc / convertCallStmt

Function convertCallStmt

internal/engine/postgresql/convert.go:654–679  ·  view source on GitHub ↗
(n *pg.CallStmt)

Source from the content-addressed store, hash-verified

652}
653
654func convertCallStmt(n *pg.CallStmt) *ast.CallStmt {
655 if n == nil {
656 return nil
657 }
658 rel, err := parseRelationFromNodes(n.Funccall.Funcname)
659 if err != nil {
660 // TODO: How should we handle errors?
661 panic(err)
662 }
663
664 return &ast.CallStmt{
665 FuncCall: &ast.FuncCall{
666 Func: rel.FuncName(),
667 Funcname: convertSlice(n.Funccall.Funcname),
668 Args: convertSlice(n.Funccall.Args),
669 AggOrder: convertSlice(n.Funccall.AggOrder),
670 AggFilter: convertNode(n.Funccall.AggFilter),
671 AggWithinGroup: n.Funccall.AggWithinGroup,
672 AggStar: n.Funccall.AggStar,
673 AggDistinct: n.Funccall.AggDistinct,
674 FuncVariadic: n.Funccall.FuncVariadic,
675 Over: convertWindowDef(n.Funccall.Over),
676 Location: int(n.Funccall.Location),
677 },
678 }
679}
680
681func convertCaseExpr(n *pg.CaseExpr) *ast.CaseExpr {
682 if n == nil {

Callers 1

convertNodeFunction · 0.85

Calls 5

parseRelationFromNodesFunction · 0.85
convertSliceFunction · 0.85
convertNodeFunction · 0.85
convertWindowDefFunction · 0.85
FuncNameMethod · 0.80

Tested by

no test coverage detected