Skip to content

Comments

fix: index operators#134

Merged
tianzhou merged 1 commit intomainfrom
index-operator
Oct 31, 2025
Merged

fix: index operators#134
tianzhou merged 1 commit intomainfrom
index-operator

Conversation

@tianzhou
Copy link
Contributor

Fix #132

Copilot AI review requested due to automatic review settings October 31, 2025 09:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@tianzhou tianzhou merged commit fd7ba5c into main Oct 31, 2025
2 checks passed
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.

Bug: Does not dump index operators

1 participant