Skip to content

Conversation

joaostorrer
Copy link
Contributor

Closes #6547.

Brief summary of the change made

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

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.

Copy link
Contributor

github-actions bot commented Jan 23, 2025

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   19269      0   100%

248 files skipped due to complete coverage.

Copy link
Contributor

@keraion keraion left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I just have two suggestions to help make the matching a bit clearer.

"ALTER",
"FOREIGN",
"TABLE",
OneOf(
Copy link
Contributor

Choose a reason for hiding this comment

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

This OneOf only has a single option. It likely can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad

"OPTIONS",
Bracketed(
Delimited(
AnyNumberOf(
Copy link
Contributor

Choose a reason for hiding this comment

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

I follow what this AnyNumberOf is doing here, but would it make more sense to make this a Sequence and making both the [ ADD | SET | DROP ] and QuotedLiteralSegment optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree

Copy link
Contributor

@keraion keraion left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@keraion keraion added this pull request to the merge queue Jan 27, 2025
Merged via the queue into sqlfluff:main with commit 5d24dd0 Jan 27, 2025
29 checks passed
@joaostorrer joaostorrer deleted the postgres_alter_foreign_table branch February 6, 2025 18:22
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.

ALTER FOREIGN TABLE unparsable in Postgres
2 participants