Skip to content

[feat] Add option to prefetch completion metadata and to persist completion metadata when switching schemas#1857

Open
scottnemes wants to merge 3 commits intodbcli:mainfrom
scottnemes:feat/add-schema-prefetch
Open

[feat] Add option to prefetch completion metadata and to persist completion metadata when switching schemas#1857
scottnemes wants to merge 3 commits intodbcli:mainfrom
scottnemes:feat/add-schema-prefetch

Conversation

@scottnemes
Copy link
Copy Markdown
Contributor

Description

Currently completion suggestions only populate / apply for the selected schema, and when you switch schemas, all completions are cleared. This PR does a few important things:

  1. Adds an option to prefetch completions for schemas automatically; this can be a list of schemas, or all schemas (or none, the default).
  2. Prefetching of completions is done in the background when the client is launched.
  3. When the user manually changes schemas (use command), completions are fetched for that schemas as usual. However if the user switches schemas again, the completions for the previously selected schema are now saved (this is independent of prefetching). So if you "use db1", then "use db2", completions for both db1 and db2 will now be available in addition to any prefetched schemas.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@scottnemes scottnemes requested a review from rolandwalker April 21, 2026 01:40
Comment thread test/myclirc
# (empty) = default, disables prefetching
# schema1,schema2 = enables prefetch for given schemas
# all = enables prefetch for all schemas
prefetch_schemas =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why off by default? Also, all is a valid schema name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants