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

Function buildMetadataFilter

backend/api/mcp/tool_schema.go:358–367  ·  view source on GitHub ↗

buildMetadataFilter builds a CEL filter string for GetDatabaseMetadataRequest. Returns the empty string when no narrowing is needed.

(schema, table string)

Source from the content-addressed store, hash-verified

356// buildMetadataFilter builds a CEL filter string for GetDatabaseMetadataRequest.
357// Returns the empty string when no narrowing is needed.
358func buildMetadataFilter(schema, table string) string {
359 var parts []string
360 if schema != "" {
361 parts = append(parts, fmt.Sprintf("schema == %q", schema))
362 }
363 if table != "" {
364 parts = append(parts, fmt.Sprintf("table == %q", table))
365 }
366 return strings.Join(parts, " && ")
367}
368
369// limitForInclude returns the per-schema `limit` value to send to the server.
370// Summary and single-table modes don't need a limit. Bulk modes request

Callers 3

TestBuildMetadataFilterFunction · 0.85
handleGetSchemaMethod · 0.85
lookupTableCandidatesMethod · 0.85

Calls 1

JoinMethod · 0.80

Tested by 1

TestBuildMetadataFilterFunction · 0.68