Skip to content

Conversation

@rolandwalker
Copy link
Contributor

Description

Let GRANT ... ON forms offer schema names as completions instead of only table names.

Fixes #578 .

As the commentary notes, the test fixtures are insufficient to test the change, but it can be verified interactively. See image.

One thing that is confusing in the code is the use of "database" vs "schema". Here the "type" is "database".

last image

Checklist

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

@rolandwalker rolandwalker self-assigned this Jan 20, 2026
Copy link
Contributor

@scottnemes scottnemes left a comment

Choose a reason for hiding this comment

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

Looks good!

Future potential idea; would be nice if tables would also come up for the given schema, but believe that would require additional fetching then (i.e. with no database selected, typing in grant all on mysql. would then fetch the tables from the mysql schema for completion).

@rolandwalker
Copy link
Contributor Author

Future potential idea

Yes, it looks like there is a lot of room for improvement, especially if we used sqlglot to more deeply examine the structure of the query. Though we might find out that sqlglot is too strict for the case of partial queries.

@rolandwalker rolandwalker merged commit bbfe7f2 into main Jan 20, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/grant-query-offer-database-completion branch January 20, 2026 20:35
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.

No autocomplete while grant databases access

3 participants