Skip to content
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

PostgreSQL: added support for CREATE ROLE and DROP ROLE statements #3010

Merged
merged 10 commits into from
Apr 5, 2022

Conversation

dnim
Copy link
Contributor

@dnim dnim commented Apr 5, 2022

Brief summary of the change made

fixes #2943

Are there any other side effects of this change that we should be aware of?

everything looks straightforward, so shouldn't be

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@dnim dnim changed the title Fixes for CREATE ROLE and DROP ROLE (postgres) PostgreSQL: added support for CREATE ROLE and DROP ROLE statements Apr 5, 2022
src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
Comment on lines 3299 to 3301
"""A `DROP ROLE` statement with CASCADE option.

https://docs.exasol.com/sql/drop_role.htm
Copy link
Member

Choose a reason for hiding this comment

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

It's not got cascade in this version?

And also let's remove the Exasol link. Did you find it in coachroach docs? Maybe that one would be better as tends to be closer to ANSI.

Copy link
Member

Choose a reason for hiding this comment

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

Updated this. If you have the coachroach link then let's add it.

src/sqlfluff/dialects/dialect_ansi.py Outdated Show resolved Hide resolved
src/sqlfluff/dialects/dialect_postgres.py Outdated Show resolved Hide resolved
dnim and others added 2 commits April 5, 2022 19:01
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #3010 (382dbc4) into main (220b4ac) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #3010   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          164       164           
  Lines        11997     12001    +4     
=========================================
+ Hits         11997     12001    +4     
Impacted Files Coverage Δ
src/sqlfluff/dialects/dialect_ansi.py 100.00% <100.00%> (ø)
src/sqlfluff/dialects/dialect_exasol.py 100.00% <100.00%> (ø)
src/sqlfluff/dialects/dialect_postgres.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 220b4ac...382dbc4. Read the comment docs.

@tunetheweb tunetheweb changed the title PostgreSQL: added support for CREATE ROLE and DROP ROLE statements PostgreSQL: added support for CREATE ROLE and DROP ROLE statements Apr 5, 2022
Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

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

I think this is good to go now!

@tunetheweb tunetheweb merged commit eb6a564 into sqlfluff:main Apr 5, 2022
@dnim
Copy link
Contributor Author

dnim commented Apr 6, 2022

@tunetheweb Thank you for your support and explanation! Next time will be more accurate :)

@tunetheweb
Copy link
Member

No probs. And sorry for just barging and taking over, rather than letting you resolve them, but looking to release 0.12.0 soon and wanted to get this included in that.

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.

Found unparsable section errors for postgres dialect
2 participants