Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for extracting and generating PostgreSQL index operator classes (e.g., varchar_pattern_ops) in index definitions. The changes enable the schema diffing tool to properly handle indexes that use non-default operator classes.
Key changes:
- Enhanced database queries to extract operator class information from PostgreSQL system catalogs
- Updated the index building logic to populate operator class data in the IR
- Modified index SQL generation to include operator class specifications
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/diff/create_index/add_index/*.sql | Test cases demonstrating index creation with operator classes (varchar_pattern_ops) |
| testdata/diff/create_index/add_index/*.json | JSON plan output showing operator class in migration steps |
| ir/queries/queries.sql | Added SQL query to extract operator class names from pg_opclass catalog |
| ir/queries/queries.sql.go | Generated code reflecting new column_opclasses field and removed unused function parameter fields |
| ir/inspector.go | Updated index building to populate operator class from query results; added unused parseIndexColumnDefinition function |
| internal/diff/index.go | Modified index SQL generation to include operator class in CREATE INDEX statements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
30d92a3 to
35f72f8
Compare
35f72f8 to
08c979f
Compare
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.
Fix #132