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

Support Rails 8.0 #2425

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Support Rails 8.0 #2425

wants to merge 13 commits into from

Conversation

andynu
Copy link
Contributor

@andynu andynu commented Feb 24, 2025

Building on top of #2424 this adds support for existing oracle_enhanced functionality to Rails 8.0. It may not fully support new Rails 8.0 features; For example there seems to be retry logic in rails now, and the oracle enhanced adapter is still doing its own thing.

  • Add write_query? implementation (mimicking postgres) to support the ability to prevent writes to a database - rails/rails@f39d72d

  • Replace the local implementation of execute, exec_query and its alias internal_exec_query with the new interface defined here rails/rails@fd24e5b of raw_execute, cast_result, and affected_rows. To support the affected_rows count this also had to add a row_count method to the coi and jdbc cursors.

  • without_prepared_statement? was removed rails/rails@2306c10

Fixes #2419

andynu added 13 commits January 31, 2025 14:23
The initial connection creation method invocations were re-written to
reduce convention by adding an explicit registration mapping between
adapter name and class.

This implements two.
- adapter: oracle_enhanced
  This is the primary one that people will use.
- adapter: oracle
  This replaces the previous emulate_oracle_adapter database config
setting which we can no longer use, since the config is not available
when we are registering this adapter name to class mapping, but
accomplishes the same end. So if you have 'emulate_oracle_adapter: true`
in your configs, remove that, and set your `adapter: oracle`.

rails/rails@009c7e7
This makes the quote_column_name and quote_table_names methods organized
more similarly to how they are the new mysql and postgres adapters.
Introduce a new `bind_block` method. Mimicking this change in the
postgres adapter: rails/rails@2b35775

Provides the expected :aN formatted bind parameter values needed by
oci8.

Thanks to dlaggero for this.
rsim#2424 (comment)
These are not supported by Rails 7.2
First test failure involves a missing method `transform_query`

Seems to have been removed in this rails commit:
fd24e5bfc9540fc00764a59ddf39a993bbd63ba2
rails/rails@fd24e5b

This method was replaced with `preprocess_query`.
@instrumenter is not defined. It was moved to a method.

rails/rails@dc522a3
- Add `write_query?` implementation (mimicking postgres) to support the ability to prevent writes to a database - rails/rails@f39d72d

- Replace the local implementation of execute, exec_query and its alias internal_exec_query with the new interface defined here rails/rails@fd24e5b#diff-e6fd03cad5e3437c76b6c5db106359124dc9feab8341ade39b9ae54af001fac9 of `raw_execute`, `cast_result`, and `affected_rows`. To support the affected_rows count this also had to add a `row_count` method to the coi and jdbc cursors.

- without_prepared_statement? was removed rails/rails@2306c10
@andynu andynu changed the title Rails 8.0 support Support Rails 8.0 Feb 24, 2025
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.

Support for Rails 8.0
1 participant