MCPcopy Create free account
hub / github.com/bytebase/bytebase / findField

Function findField

backend/common/cel.go:241–264  ·  view source on GitHub ↗
(callExpr *exprproto.Expr_Call, factors *QueryExportFactors)

Source from the content-addressed store, hash-verified

239}
240
241func findField(callExpr *exprproto.Expr_Call, factors *QueryExportFactors) {
242 if callExpr == nil {
243 return
244 }
245 if len(callExpr.Args) == 2 {
246 idExpr := callExpr.Args[0].GetIdentExpr()
247 if idExpr != nil {
248 if idExpr.Name == CELAttributeResourceDatabase && callExpr.Function == "_==_" {
249 factors.Databases = append(factors.Databases, callExpr.Args[1].GetConstExpr().GetStringValue())
250 }
251 if idExpr.Name == CELAttributeResourceDatabase && callExpr.Function == "@in" {
252 list := callExpr.Args[1].GetListExpr()
253 for _, element := range list.Elements {
254 factors.Databases = append(factors.Databases, element.GetConstExpr().GetStringValue())
255 }
256 }
257 return
258 }
259 }
260 for _, arg := range callExpr.Args {
261 callExpr := arg.GetCallExpr()
262 findField(callExpr, factors)
263 }
264}
265
266func EvalBindingCondition(expr string, requestTime time.Time) (bool, error) {
267 input := map[string]any{

Callers 1

GetQueryExportFactorsFunction · 0.85

Calls 1

GetStringValueMethod · 0.80

Tested by

no test coverage detected