Skip to content

chore: simplify inspector#116

Merged
tianzhou merged 1 commit intomainfrom
simplify
Oct 23, 2025
Merged

chore: simplify inspector#116
tianzhou merged 1 commit intomainfrom
simplify

Conversation

@tianzhou
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 23, 2025 07:46
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 PR simplifies the index inspection logic by eliminating SQL parsing dependencies. The changes move from parsing index definitions using pg_query_go to directly extracting index column information from PostgreSQL's system catalogs.

Key Changes:

  • Replaced complex AST-based index definition parsing with direct SQL queries to pg_get_indexdef and indoption array
  • Removed dependency on github.com/pganalyze/pg_query_go/v6
  • Deleted ~250 lines of parsing helper functions that are no longer needed

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ir/queries/queries.sql Extended index query to directly extract column names, positions, and sort directions using PostgreSQL system functions
ir/queries/queries.sql.go Generated code adding new fields (NumColumns, ColumnDefinitions, ColumnDirections) to GetIndexesForSchemaRow struct
ir/inspector.go Removed pg_query dependency and replaced parseIndexDefinition with direct iteration over query results; deleted all AST extraction helper functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tianzhou tianzhou merged commit 7c883ef into main Oct 23, 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.

2 participants