MCPcopy Create free account
hub / github.com/dolthub/doltgresql / handleLanguageSQLAs

Function handleLanguageSQLAs

server/ast/create_function.go:210–217  ·  view source on GitHub ↗

handleLanguageSQLAs handles parsing SQL definition strings in both CREATE FUNCTION and CREATE PROCEDURE and returns converted the sql statements into vitess statements.

(definition string, params []pgnodes.RoutineParam)

Source from the content-addressed store, hash-verified

208// handleLanguageSQLAs handles parsing SQL definition strings in both CREATE FUNCTION and CREATE PROCEDURE
209// and returns converted the sql statements into vitess statements.
210func handleLanguageSQLAs(definition string, params []pgnodes.RoutineParam) (string, []vitess.Statement, error) {
211 stmts, err := parser.Parse(definition)
212 if err != nil {
213 return "", nil, err
214 }
215
216 return convertSQLStmts(stmts, params)
217}
218
219// convertSQLStmts takes parser.Statements and routine parameters and
220// returns converted to string representation and vitess statements.

Callers 2

nodeCreateFunctionFunction · 0.85
nodeCreateProcedureFunction · 0.85

Calls 2

ParseFunction · 0.92
convertSQLStmtsFunction · 0.85

Tested by

no test coverage detected