Add support for index constraint added when altering a table (Postgres)#38
Merged
TylerBrinks merged 1 commit intoSep 16, 2024
Conversation
TylerBrinks
approved these changes
Sep 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! I was playing a bit around with using this library as part of some automated testing of our PostgreSQL queries.
I hit a case that wasn't covered, as it is probably quite an edge case. Specifically, the
table_constraint_using_indexcase from: https://www.postgresql.org/docs/current/sql-altertable.html for example:ALTER TABLE table_name ADD CONSTRAINT constraint_name UNIQUE USING INDEX index_nameI must admit that I haven't checked if this is present on ANSI, so I've considered it Postgres specific.
It's also specific to
ALTER TABLEstatements, which also makes the code a bit iffy.I am not sure when I can come back to this, so feel free to make any changes to the branch you see fit i I'm not back in a timely manner. Given that this might be a bit of an edge case for the library, I also completely respect if you don't think this change is fit for purpose.