MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / AsRoutineLanguage

Function AsRoutineLanguage

pkg/sql/sem/tree/create_routine.go:296–306  ·  view source on GitHub ↗

AsRoutineLanguage converts a string to a RoutineLanguage if applicable. No error is returned if string does not represent a valid UDF language; unknown languages result in an error later.

(lang string)

Source from the content-addressed store, hash-verified

294// No error is returned if string does not represent a valid UDF language;
295// unknown languages result in an error later.
296func AsRoutineLanguage(lang string) (RoutineLanguage, error) {
297 switch strings.ToLower(lang) {
298 case "sql":
299 return RoutineLangSQL, nil
300 case "plpgsql":
301 return RoutineLangPLpgSQL, nil
302 case "c":
303 return RoutineLangC, nil
304 }
305 return RoutineLanguage(lang), nil
306}
307
308// RoutineSecurity indicates the mode of security that the routine will
309// be executed with.

Callers 1

ParseMethod · 0.92

Calls 1

RoutineLanguageTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…