| 9 | ) |
| 10 | |
| 11 | func 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 | |
| 30 | func convertSubLinkType(t pg.SubLinkType) (ast.SubLinkType, error) { |
| 31 | switch t { |