listAllDatabaseNames returns the instance's database names, or nil if the completion context cannot enumerate them.
(ctx context.Context, cCtx base.CompletionContext)
| 197 | // listAllDatabaseNames returns the instance's database names, or nil if the |
| 198 | // completion context cannot enumerate them. |
| 199 | func 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. |