Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances constraint name quoting to properly handle identifiers that require quotes according to PostgreSQL rules, specifically addressing constraint names containing whitespace as mentioned in GitHub issue #78.
- Systematically wraps all constraint name references with
ir.QuoteIdentifier()across the codebase - Adds test case with a constraint named "price not negative" to verify proper quoting of names with spaces
- Updates test function name and test data directory to reflect the expanded scope
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/dump/issue_78_constraint_not_valid_and_quoting/raw.sql | Adds test constraint with whitespace in name to verify proper quoting |
| testdata/dump/issue_78_constraint_not_valid_and_quoting/pgschema.sql | Expected pgschema output showing properly quoted constraint name |
| testdata/dump/issue_78_constraint_not_valid_and_quoting/pgdump.sql | Expected pgdump output showing properly quoted constraint name |
| testdata/dump/issue_78_constraint_not_valid_and_quoting/manifest.json | Test manifest documenting the constraint name quoting test case |
| testdata/dump/issue_78_constraint_not_valid/manifest.json | Removed old manifest (test case consolidated) |
| internal/plan/rewrite.go | Wraps constraint names with ir.QuoteIdentifier() in rewrite operations |
| internal/diff/type.go | Wraps constraint names with ir.QuoteIdentifier() in domain type ALTER statements |
| internal/diff/trigger.go | Wraps trigger names with ir.QuoteIdentifier() for constraint triggers |
| internal/diff/table.go | Wraps constraint names with ir.QuoteIdentifier() throughout table ALTER statements |
| internal/diff/constraint.go | Wraps constraint names with ir.QuoteIdentifier() in constraint SQL generation |
| cmd/dump/dump_integration_test.go | Renames test function to reflect expanded scope including quoting tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Further fix #78