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

Method GetFunction

server/types/function_registry.go:78–94  ·  view source on GitHub ↗

GetFunction returns the associated function for the given ID. This will always return a valid function.

(ctx *sql.Context, id uint32)

Source from the content-addressed store, hash-verified

76
77// GetFunction returns the associated function for the given ID. This will always return a valid function.
78func (r *functionRegistry) GetFunction(ctx *sql.Context, id uint32) QuickFunction {
79 r.mutex.Lock()
80 defer r.mutex.Unlock()
81 f := r.functions[id]
82 if f != nil {
83 return f
84 }
85 if id == 0 {
86 return nil
87 }
88 f = r.loadFunction(ctx, id)
89 if f == nil {
90 // If we hit this panic, then we're missing a test that uses this function (and we should add that test)
91 panic(errors.Errorf("cannot find function: `%s`", r.revMapping[id]))
92 }
93 return f
94}
95
96// GetInternalID returns the function's Internal ID associated with the given registry ID.
97func (r *functionRegistry) GetInternalID(registryID uint32) id.Function {

Callers 9

CompareMethod · 0.45
IoInputMethod · 0.45
IoOutputMethod · 0.45
TypModInMethod · 0.45
TypModOutMethod · 0.45
CallSendMethod · 0.45
CallReceiveMethod · 0.45
loadFunctionFunction · 0.45
RowIterMethod · 0.45

Calls 4

loadFunctionMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected