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

Function convertCreateFunctionStmt

internal/engine/postgresql/convert.go:1089–1104  ·  view source on GitHub ↗
(n *pg.CreateFunctionStmt)

Source from the content-addressed store, hash-verified

1087}
1088
1089func convertCreateFunctionStmt(n *pg.CreateFunctionStmt) *ast.CreateFunctionStmt {
1090 if n == nil {
1091 return nil
1092 }
1093 rel, err := parseRelationFromNodes(n.Funcname)
1094 if err != nil {
1095 panic(err)
1096 }
1097 return &ast.CreateFunctionStmt{
1098 Replace: n.Replace,
1099 Func: rel.FuncName(),
1100 Params: convertSlice(n.Parameters),
1101 ReturnType: convertTypeName(n.ReturnType),
1102 Options: convertSlice(n.Options),
1103 }
1104}
1105
1106func convertCreateOpClassItem(n *pg.CreateOpClassItem) *ast.CreateOpClassItem {
1107 if n == nil {

Callers 1

convertNodeFunction · 0.85

Calls 4

parseRelationFromNodesFunction · 0.85
convertSliceFunction · 0.85
FuncNameMethod · 0.80
convertTypeNameFunction · 0.70

Tested by

no test coverage detected