Rails 8.1 support#2480
Conversation
f942020 to
e834b46
Compare
72a17f3 to
e4b0156
Compare
e4b0156 to
29a404c
Compare
|
Certainly. Dropped. |
e458c74 to
e3e858a
Compare
|
Better. Rather than dropping, I just rebased this on top of master again. Since those commits were from earlier. |
|
Amazing work @andynu! I just want to point your attention also to #2483 as a big improvement of performance and memory usage for workloads involving LOBs. Basically I remove this |
| # After setting large objects to empty, select the OCI8::LOB | ||
| # and write back the data. | ||
| before_create :record_lobs_for_create | ||
| after_create :enhanced_write_lobs |
There was a problem hiding this comment.
For create, shouldn't it just write all non-empty and non-null lobs instead of tracking them?
But anyway, I think this LOB callback writing stuff needs to go unless there are non-easily adaptable use-cases for disabling prepared statements as discussed in #2483
P.S. adding this here, doesn't it mean write_lobs was not used for a long time on create already? And that people just use prepared statements and don't need this?
151e629 to
942c50e
Compare
|
Updated per review feedback. This PR is now stacked on:
I'm actively using this branch in production, and need those fixes, I could conceivably branch again for me needs, and flip the order of these PRs, but my preference would be for a review and decision on those two PRs before merging this one if at all possible. Also both stem from a rails 8.1 change (query_log_tags_enabled) forcing Changes in this update:
|
942c50e to
fdb161d
Compare
|
Thank you for your work on this. My request would be to keep this pull request minimal for Rails 8.1 support and separate those fixes #2485 #2486 into their own pull requests, so that we can backport them to address issues occurring in 8.0 as well. If those fixes are included in this Rails 8.1 pull request, it would be difficult to cherry-pick them back to 8.0. With that in mind, I'd prefer to first merge the minimal Rails 8.1 support, and then review those two pull requests separately afterward. I hope this approach works for you. |
|
Yasuo, Thank you. That is a kindness. I was going to attempt to re-stack
the PRs with rails-8-1-support in front after work today; And still can,
but if those other two PRs are acceptable, I do think they would go nicely
with the rails-8-1-support PR, and would still allow for back-porting.
…On Thu, Jan 29, 2026 at 10:38 AM Yasuo Honda ***@***.***> wrote:
*yahonda* left a comment (rsim/oracle-enhanced#2480)
<#2480 (comment)>
In #2489 <#2489>, I
temporarily changed the Rails branch in Oracle enhanced adapter's master
from main to 8-0-stable. This should allow #2485
<#2485> and #2486
<#2486> to be reviewed before
#2480 <#2480>.
—
Reply to this email directly, view it on GitHub
<#2480 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAONGMJ35TUEP5Z5R5MPUD4JISPRAVCNFSM6AAAAACKBOBP22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQMJYGQ3DKNZZHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
bc88c65 to
151e629
Compare
Add ability to write LOB data to tables that don't have a primary key by: 1. Exposing cursor.rowid method in OCI connection wrapper 2. Capturing ROWID after INSERT in exec_insert (@last_insert_rowid) 3. Using ROWID in write_lobs WHERE clause when no PK is available 4. Supporting composite primary keys (Array) in write_lobs The ROWID approach works because: - Ruby-oci8's cursor.rowid returns the ROWID of the last inserted row - ROWID uniquely identifies any row regardless of table structure - The after_create callback fires immediately after INSERT on same connection Also includes ORA-01741 diagnostic logging for empty column detection.
…ents This spec clearly demonstrates the critical difference between LOB handling with prepared statements (bind parameters) vs without (raw SQL with empty_clob()). Key points demonstrated: - With prepared_statements: true, LOB data flows through type_cast() which creates OCI8::CLOB temp LOBs. Data is populated BEFORE INSERT. - With prepared_statements: false, SQL contains empty_clob() literals. The write_lobs callback is REQUIRED to populate LOB data after INSERT. This test suite will FAIL if the lob.rb callbacks are removed, proving they are necessary for backwards compatibility with prepared_statements: false. Related to: rsim#2483
Rails 8.1 removed the ExplainSubscriber class (commit f488878f1bc), causing test failures with: NameError: uninitialized constant ActiveRecord::ExplainSubscriber The ExplainSubscriber functionality was refactored into ExplainRegistry with lazy subscription - instead of subscribing at initialization, Rails 8.1 now subscribes only when .explain is first called via ExplainRegistry.start. The spec_helper.rb line that manually subscribed to ExplainSubscriber is no longer needed or valid. Rails 8.1 handles the subscription automatically and lazily. Related Rails commit: - f488878f1bc "Refactor ExplainRegistry to only be subscribed once used" - Author: Jean Boussier - Date: Thu Sep 25 10:37:09 2025 +0200 - Link: rails/rails@f488878
Switch from pre-release alpha constraint to stable release constraint for ActiveRecord 8.1.0 dependency, following Rails 8.1 stable release.
Document Rails 8.1 support with installation instructions, including the gem version constraint for activerecord-oracle_enhanced-adapter 8.1.
151e629 to
81e1a6a
Compare
|
@yahonda Is there anything I can help with that might unblock a release? |
This PR brings full Rails 8.1 compatibility to the Oracle Enhanced adapter, building on excellent work by @akostadinov (Aleksandar N. Kostadinov) in PR #2471.
I've added only two additional fixes:
Credits
The vast majority of this work was done by Aleksandar N. Kostadinov (@akostadinov) and Daria Mayorova (@mayorova). Their comprehensive compatibility updates fixed nearly all Rails 8.1 issues.
Changes from @akostadinov's PR #2471
Core Rails 8.1 API Compatibility
constructors
Test Infrastructure & Coverage
My Contributions (this PR)
CLOB Insertion Fix
prepared_statements: false(which happens when config.active_record.query_log_tags_enabled = true) #2477Uses ROWID for clob update statements to avoid issues with missing primary keys and/or composite primary keys. (e4b0156)Rails 8.1 ExplainSubscriber Removal
(rails/rails@f488878)
Testing
All tests pass against Rails 8.1 (8-1-stable branch).