MCPcopy Create free account
hub / github.com/cockscomb/cel2sql / findSchema

Method findSchema

bq/provider.go:31–51  ·  view source on GitHub ↗
(typeName string)

Source from the content-addressed store, hash-verified

29}
30
31func (p *typeProvider) findSchema(typeName string) (bigquery.Schema, bool) {
32 typeNames := strings.Split(typeName, ".")
33 schema, found := p.schemas[typeNames[0]]
34 if !found {
35 return nil, false
36 }
37 for _, tn := range typeNames[1:] {
38 var s *bigquery.Schema
39 for _, fieldSchema := range schema {
40 if fieldSchema.Name == tn {
41 s = &fieldSchema.Schema
42 break
43 }
44 }
45 if s == nil {
46 return nil, false
47 }
48 schema = *s
49 }
50 return schema, true
51}
52
53func (p *typeProvider) FindType(typeName string) (*exprpb.Type, bool) {
54 _, found := p.findSchema(typeName)

Callers 2

FindTypeMethod · 0.95
FindFieldTypeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected