Skip to content

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

Merged
scottnemes merged 6 commits intodbcli:mainfrom
scottnemes:feat/add-schema-prefetch
Apr 22, 2026
Merged

[feat] Add option to prefetch completion metadata and to persist completion metadata when switching schemas (#109)#1857
scottnemes merged 6 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 Outdated
Comment thread mycli/schema_prefetcher.py Outdated
Comment thread mycli/schema_prefetcher.py Outdated
Comment thread mycli/schema_prefetcher.py
Copy link
Copy Markdown
Contributor

@rolandwalker rolandwalker left a comment

Choose a reason for hiding this comment

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

So nice!

@scottnemes scottnemes merged commit 20c7494 into dbcli:main Apr 22, 2026
8 checks passed
@scottnemes scottnemes deleted the feat/add-schema-prefetch branch April 22, 2026 21:19
@scottnemes scottnemes self-assigned this Apr 22, 2026
@scottnemes scottnemes changed the title [feat] Add option to prefetch completion metadata and to persist completion metadata when switching schemas [feat] Add option to prefetch completion metadata and to persist completion metadata when switching schemas (#109) Apr 23, 2026
@scottnemes
Copy link
Copy Markdown
Contributor Author

#109

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