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

Method loadFunction

server/types/function_registry.go:111–133  ·  view source on GitHub ↗

loadFunction loads the given function

(ctx *sql.Context, id uint32)

Source from the content-addressed store, hash-verified

109
110// loadFunction loads the given function
111func (r *functionRegistry) loadFunction(ctx *sql.Context, id uint32) QuickFunction {
112 // We make this check a second time (first in GetFunction) since the function may have been added while another
113 // function acquired the lock.
114 f := r.functions[id]
115 if f != nil {
116 return f
117 }
118 if LoadFunctionFromCatalog == nil {
119 return nil
120 }
121 functionID := r.revMapping[id]
122 if !functionID.IsValid() {
123 return nil
124 }
125 funcName, types := r.toFuncSignature(functionID)
126 potentialFunction := LoadFunctionFromCatalog(ctx, funcName, types)
127 if potentialFunction == nil {
128 return nil
129 }
130 f = potentialFunction.(QuickFunction)
131 r.functions[id] = f
132 return f
133}
134
135// nameWithoutParams returns the name only from the given function string.
136func (*functionRegistry) nameWithoutParams(functionID id.Function) string {

Callers 1

GetFunctionMethod · 0.95

Calls 2

toFuncSignatureMethod · 0.95
IsValidMethod · 0.45

Tested by

no test coverage detected