Improve Red Arrow Active Record integration - #22
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes GH-21 by improving interoperability between activerecord-adbc-adapter and Red Arrow Active Record, ensuring to_arrow / each_record_batch work correctly for both ADBC-backed models and “normal” ActiveRecord adapter-backed models in the same test run.
Changes:
- Add Red Arrow Active Record as a runtime dependency and load it so non-ADBC relations can use the upstream implementations.
- Update relation Arrow conversion methods to use the ADBC-specific path only for this adapter and fall back to
superotherwise. - Extend the test harness to establish a secondary “raw” ActiveRecord connection (SQLite3/PostgreSQL) and add coverage for batching behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lib/activerecord_adbc_adapter/relation_arrowable.rb |
Adds Red Arrow Active Record require and routes to_arrow / each_record_batch to ADBC implementation vs super based on adapter class. |
test/helper.rb |
Establishes an additional non-ADBC AR connection for RawUser to validate Red Arrow Active Record behavior; adjusts DB creation config for PostgreSQL. |
test/helper/user.rb |
Introduces RawUser mapped to the same users table without ADBC ingest mixin. |
test/test_model.rb |
Adds/updates tests to cover Red Arrow Active Record batching (batch_size) and record batch enumeration. |
Gemfile |
Adds sqlite3 for test runs that use the raw ActiveRecord SQLite3 adapter. |
activerecord-adbc-adapter.gemspec |
Adds runtime dependency on red-arrow-activerecord (>= 0.1.4). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| end | ||
| setup = lambda do | ||
| ActiveRecord::Base.establish_connection(adapter: "adbc", **options) | ||
| if ar_adapter_name |
| } | ||
| ar_adapter_name = "sqlite3" | ||
| ar_adapter_options = { | ||
| database: nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix GH-21
Reported by Dmytro Piliugin. Thanks!!!