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

Function matchCaseInsensitive

backend/api/mcp/tool_resolve.go:269–278  ·  view source on GitHub ↗

matchCaseInsensitive returns databases whose short name matches case-insensitively.

(databases []databaseEntry, name string)

Source from the content-addressed store, hash-verified

267
268// matchCaseInsensitive returns databases whose short name matches case-insensitively.
269func matchCaseInsensitive(databases []databaseEntry, name string) []databaseEntry {
270 var result []databaseEntry
271 lower := strings.ToLower(name)
272 for _, db := range databases {
273 if strings.ToLower(extractDatabaseName(db.Name)) == lower {
274 result = append(result, db)
275 }
276 }
277 return result
278}
279
280// matchSubstring returns databases whose short name contains the input as a substring.
281func matchSubstring(databases []databaseEntry, name string) []databaseEntry {

Callers 1

matchDatabasesFunction · 0.85

Calls 1

extractDatabaseNameFunction · 0.70

Tested by

no test coverage detected