Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for INDEX INCLUDE #1301

Merged
merged 2 commits into from
Feb 15, 2025
Merged

Add support for INDEX INCLUDE #1301

merged 2 commits into from
Feb 15, 2025

Conversation

aidanharan
Copy link
Contributor

@aidanharan aidanharan commented Feb 14, 2025

Add support for index include as requested in #473

Running the following:

connection.add_index("testings", "last_name", include: :foo)

Before this PR generates:

CREATE INDEX [index_testings_on_last_name] ON [testings] ([last_name])

After the PR it will generate:

CREATE INDEX [index_testings_on_last_name] ON [testings] ([last_name]) INCLUDE ([foo])

Multiple include columns are supported using:

connection.add_index("testings", "last_name", include: [:foo, :bar])

Ref: rails/rails#44803

@aidanharan aidanharan changed the title Add support for index include Add support for INDEX INCLUDE Feb 14, 2025
@aidanharan
Copy link
Contributor Author

Tests will be included as part of the ActiveRecord tests after rails/rails#54532 is merged.

@aidanharan aidanharan marked this pull request as ready for review February 14, 2025 19:19
@aidanharan aidanharan merged commit 8d4c6bc into main Feb 15, 2025
3 of 6 checks passed
@aidanharan aidanharan deleted the index-includes branch February 15, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant