Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for expression indexes to the PostgreSQL query builder. Expression indexes allow creating indexes on computed expressions (like lower(email)) rather than just simple columns. The implementation changes the internal representation of index columns from Vec<Iden> to Vec<Expr> and adds a new expr() method to the CreateIndex builder.
Changes:
- Modified the
CreateIndexstruct to useVec<Expr>instead ofVec<Iden>for columns, enabling support for both simple column references and complex expressions - Added new
expr()method for adding expression-based index entries - Updated
write_index_columns()to usewrite_tuple()for rendering, and madewrite_tuple()publicly accessible within the crate
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pqb/src/index/create.rs | Modified column type from Vec to Vec, added expr() method, updated write_index_columns to use write_tuple |
| pqb/src/expr.rs | Changed write_tuple visibility from private to pub(crate) to enable use in index module |
| pqb/tests/index.rs | Updated all existing test expectations to reflect new SQL output format and added two new tests for expression indexes |
| pqb/tests/create_table.rs | Updated PRIMARY KEY test expectation to match new rendering behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.