Skip to content

Keep favorite query names unchanged in list - #2496

Open
goul4rt wants to merge 1 commit into
dbcli:mainfrom
goul4rt:fix/favorite-list-names
Open

goul4rt wants to merge 1 commit into
dbcli:mainfrom
goul4rt:fix/favorite-list-names

Conversation

@goul4rt

@goul4rt goul4rt commented Dec 4, 2026

Copy link
Copy Markdown

Description

FavoriteQueries.list() ran _clean_query on each favorite's name instead of its query. A name such as q; (easy to get from /fs q; select 1) was listed as q, so the listing showed an empty query for it and completion offered a name that doesn't exist. It now returns the names as stored. Added a test.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the mycli/AUTHORS.txt 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 .

FavoriteQueries.list() ran the query cleanup on each name, so a name
like "q;" was listed as "q" and its query could not be found.
@rolandwalker

Copy link
Copy Markdown
Contributor

Hi! Thanks! Welcome!

I see how the code reads more sensibly right away, because the _clean_query() method was applied to a name, not a query.

But with this change, _clean_query() is applied to neither the name nor the query, so isn't the query not getting cleaned as it should?

Also, should favorite query names contain semicolons? I kinda think they should not. Maybe this code was intentional to enforce that, and the naming of the method _clean_query() was just confusing in this context.

We should look deeper.

This branch has not been deployed

No deployments
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