Skip to content

Improve Red Arrow Active Record integration - #22

Merged
kou merged 1 commit into
red-data-tools:mainfrom
kou:arrowable
Jun 10, 2026
Merged

Improve Red Arrow Active Record integration#22
kou merged 1 commit into
red-data-tools:mainfrom
kou:arrowable

Conversation

@kou

@kou kou commented May 22, 2026

Copy link
Copy Markdown
Member

Fix GH-21

Reported by Dmytro Piliugin. Thanks!!!

Copilot AI review requested due to automatic review settings May 22, 2026 00:43

Copilot AI left a comment

Copy link
Copy Markdown

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 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 super otherwise.
  • 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.

Comment thread test/helper.rb Outdated
end
setup = lambda do
ActiveRecord::Base.establish_connection(adapter: "adbc", **options)
if ar_adapter_name
Comment thread test/helper.rb Outdated
}
ar_adapter_name = "sqlite3"
ar_adapter_options = {
database: nil
@kou
kou merged commit baf32ce into red-data-tools:main Jun 10, 2026
0 of 3 checks passed
@kou
kou deleted the arrowable branch June 10, 2026 00:52
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