Skip to content

Add support for DENY statements #1836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

aharpervc
Copy link
Contributor

@aharpervc aharpervc commented May 1, 2025

This is another statement for SQL Server: https://learn.microsoft.com/en-us/sql/t-sql/statements/deny-transact-sql, but implemented in a common way. Similar to GRANT & REVOKE, so using a lot of those patterns with a similar test.

Supplementary improvements:

  1. While I was working on that, I also noticed that EXEC was missing from the privileges list, so that's added now too (with a test example).
  2. Additionally, SQL Server supports identifiers quoted [like this]. That dialect function hadn't been implemented yet, which caused a test failure on example that use that quoting style. So I've added that now too with a couple example cases for grant/deny.
  3. Finally, "public" is a built in role on SQL Server, so doing something like grant select on mytable to public should parse public normally. However, the former logic was reading it as a keyword. This has been adjusted to be not special on SQL Server and tests cases have been added as well.

@aharpervc aharpervc marked this pull request as draft May 1, 2025 22:11
@aharpervc aharpervc marked this pull request as ready for review May 1, 2025 22:30
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.

1 participant