GetFunction gets the function by name. Note: For overloaded functions, this returns the first match by name only. Use signature-based lookup for precise matching.
(name string)
| 398 | // Note: For overloaded functions, this returns the first match by name only. |
| 399 | // Use signature-based lookup for precise matching. |
| 400 | func (s *SchemaMetadata) GetFunction(name string) *storepb.FunctionMetadata { |
| 401 | for _, function := range s.proto.GetFunctions() { |
| 402 | if s.isDetailCaseSensitive { |
| 403 | if function.Name == name { |
| 404 | return function |
| 405 | } |
| 406 | } else { |
| 407 | if strings.EqualFold(function.Name, name) { |
| 408 | return function |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | return nil |
| 413 | } |
| 414 | |
| 415 | // GetSequence gets the sequence by name. |
| 416 | func (s *SchemaMetadata) GetSequence(name string) *storepb.SequenceMetadata { |
no test coverage detected