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

Function listAllDatabaseNames

backend/plugin/parser/tidb/completion.go:199–208  ·  view source on GitHub ↗

listAllDatabaseNames returns the instance's database names, or nil if the completion context cannot enumerate them.

(ctx context.Context, cCtx base.CompletionContext)

Source from the content-addressed store, hash-verified

197// listAllDatabaseNames returns the instance's database names, or nil if the
198// completion context cannot enumerate them.
199func listAllDatabaseNames(ctx context.Context, cCtx base.CompletionContext) []string {
200 if cCtx.ListDatabaseNames == nil {
201 return nil
202 }
203 names, err := cCtx.ListDatabaseNames(ctx, cCtx.InstanceID)
204 if err != nil {
205 return nil
206 }
207 return names
208}
209
210// statementReferencesDatabase reports whether dbName appears as a database
211// qualifier (`dbName.`) in the statement, at an identifier boundary.

Callers 1

buildCatalogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected