Skip to content

Upgrade: Introduce Parameter Object: QueryIntent#1380

Draft
aidanharan wants to merge 9 commits intomainfrom
query-intent
Draft

Upgrade: Introduce Parameter Object: QueryIntent#1380
aidanharan wants to merge 9 commits intomainfrom
query-intent

Conversation

@aidanharan
Copy link
Contributor

Upgrade the adapter so that it passes against Rails main branch till after rails/rails#55897 was merged.

@aidanharan aidanharan self-assigned this Feb 7, 2026
@aidanharan aidanharan changed the title Query intent Upgrade: Introduce Parameter Object: QueryIntent Feb 7, 2026
Copy link

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 upgrades the ActiveRecord SQL Server adapter to be compatible with Rails main branch after the introduction of the QueryIntent parameter object pattern (Rails PR #55897). The changes refactor the adapter to use the new QueryIntent API instead of passing individual sql, binds, and name parameters.

Changes:

  • Refactored database statement methods to use QueryIntent parameter object pattern
  • Updated test assertions to match new Rails error message formats
  • Fixed query cache to use accessor method instead of instance variable
  • Enhanced timestamp logic to respect user-provided values in upsert operations

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/active_record/connection_adapters/sqlserver/database_statements.rb Updated perform_query signature to accept QueryIntent; replaced exec_delete/exec_update with delete/update methods using QueryIntent; enhanced timestamp logic for upsert operations
lib/active_record/connection_adapters/sqlserver/showplan.rb Updated set_showplan_option to create and pass QueryIntent to raw_execute
lib/active_record/connection_adapters/sqlserver/schema_statements.rb Updated indexes method to use QueryIntent when calling select
test/support/query_assertions.rb Updated assertion error messages to match Rails' new format with conditional query listing
test/support/core_ext/query_cache.rb Changed @query_cache instance variable access to query_cache method call
test/cases/coerced_tests.rb Updated test expectations for new "matching queries" error message format
Gemfile Updated minitest to ~> 6.0 and added minitest-mock dependency
compose.ci.yaml Changed from RAILS_BRANCH to RAILS_COMMIT=65dc2163e3 for CI environment
Dockerfile.ci Changed from RAILS_BRANCH to RAILS_COMMIT=65dc2163e3 for Docker build
AGENTS.md Added comprehensive documentation for AI coding agents working with the repository

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Comments