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

Function convertFuncParamMode

internal/engine/postgresql/convert.go:11–28  ·  view source on GitHub ↗
(m pg.FunctionParameterMode)

Source from the content-addressed store, hash-verified

9)
10
11func convertFuncParamMode(m pg.FunctionParameterMode) (ast.FuncParamMode, error) {
12 switch m {
13 case pg.FunctionParameterMode_FUNC_PARAM_IN:
14 return ast.FuncParamIn, nil
15 case pg.FunctionParameterMode_FUNC_PARAM_OUT:
16 return ast.FuncParamOut, nil
17 case pg.FunctionParameterMode_FUNC_PARAM_INOUT:
18 return ast.FuncParamInOut, nil
19 case pg.FunctionParameterMode_FUNC_PARAM_VARIADIC:
20 return ast.FuncParamVariadic, nil
21 case pg.FunctionParameterMode_FUNC_PARAM_TABLE:
22 return ast.FuncParamTable, nil
23 case pg.FunctionParameterMode_FUNC_PARAM_DEFAULT:
24 return ast.FuncParamDefault, nil
25 default:
26 return -1, fmt.Errorf("parse func param: invalid mode %v", m)
27 }
28}
29
30func convertSubLinkType(t pg.SubLinkType) (ast.SubLinkType, error) {
31 switch t {

Callers 1

translateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected