rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
544 stars 308 forks source link

Please privide Rails 7.1 compatibility #2357

Open drgcms opened 5 months ago

drgcms commented 5 months ago

Steps to reproduce

Database connection

Expected behavior

Success

Actual behavior

oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:699:in `get_database_version' activerecord (7.1.2) lib/active_record/connection_adapters/schema_cache.rb:374:in `database_version' activerecord (7.1.2) lib/active_record/connection_adapters/schema_cache.rb:70:in `database_version' activerecord (7.1.2) lib/active_record/connection_adapters/schema_cache.rb:200:in `database_version' activerecord (7.1.2) lib/active_record/connection_adapters/abstract_adapter.rb:871:in `database_version' oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:307:in `supports_fetch_first_n_rows_and_offset?' oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:271:in `arel_visitor' activerecord (7.1.2) lib/active_record/connection_adapters/abstract_adapter.rb:159:in `initialize' oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:250:in `initialize' oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:76:in `new' oracle-enhanced (deb214decc37) lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:76:in `oracle_enhanced_connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:673:in `public_send' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:673:in `new_connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:720:in `checkout_new_connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:699:in `try_to_checkout_new_connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:657:in `acquire_connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `connection' activerecord (7.1.2) lib/active_record/connection_adapters/abstract/connection_handler.rb:246:in `retrieve_connection' activerecord (7.1.2) lib/active_record/connection_handling.rb:287:in `retrieve_connection' activerecord (7.1.2) lib/active_record/connection_handling.rb:254:in `connection' activerecord (7.1.2) lib/active_record/model_schema.rb:618:in `load_schema!' activerecord (7.1.2) lib/active_record/attributes.rb:264:in `load_schema!' activerecord (7.1.2) lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!' activerecord (7.1.2) lib/active_record/model_schema.rb:563:in `block in load_schema' activerecord (7.1.2) lib/active_record/model_schema.rb:560:in `synchronize' activerecord (7.1.2) lib/active_record/model_schema.rb:560:in `load_schema' activerecord (7.1.2) lib/active_record/model_schema.rb:441:in `attribute_types' activerecord (7.1.2) lib/active_record/model_schema.rb:467:in `type_for_attribute' activerecord (7.1.2) lib/active_record/type_caster/map.rb:16:in `type_for_attribute' activerecord (7.1.2) lib/arel/table.rb:111:in `type_for_attribute' activerecord (7.1.2) lib/active_record/table_metadata.rb:18:in `type' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:59:in `build' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:54:in `[]' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:132:in `block in expand_from_hash' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:79:in `each' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:79:in `flat_map' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:79:in `expand_from_hash' activerecord (7.1.2) lib/active_record/relation/predicate_builder.rb:25:in `build_from_hash' activerecord (7.1.2) lib/active_record/relation/query_methods.rb:1526:in `build_where_clause' activerecord (7.1.2) lib/active_record/relation/query_methods.rb:943:in `where!' activerecord (7.1.2) lib/active_record/relation/query_methods.rb:938:in `where' activerecord (7.1.2) lib/active_record/querying.rb:23:in `where' /home/rails/register/app/renderers/register_renderer.rb:102:in `finance'

System configuration

Rails version: rails (7.1.2)

Oracle enhanced adapter version: activerecord-oracle_enhanced-adapter (7.1.0.alpha deb214d)

Ruby version: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

Oracle Database version: 12.1.0.2.0

Thanks TheR

jarl-dk commented 3 months ago

This request covers https://github.com/rsim/oracle-enhanced/issues/2329

andynu commented 3 months ago

Hi Everyone,

I'm interested in helping move this forward. I've started a series of PRs to work through test regressions on the way to rails 7.1 support. Right now I'm providing them as stacked PRs so you can see the passing tests. I'd be happy to provide them again as independent PRs, each one really just contains a rails feature bump and a single commit of the fixing changes. Since there is no contribution guide here, I'm not sure if this is the most desirable approach. Please let me know if I can change tactics to make this easier on the maintainers.

I would appreciate any feedback you have. I'm trying to be as minimal as possible in the changes to make these tests pass, there are already scenarios where a larger change might be more appropriate. Thank you!!!

davinlagerroos commented 3 months ago

First, thanks @andynu for the work you've put in to upgrading this library!

Second, I am by no means an expert in this library or its patterns. My group uses this gem and I have been looking at a 7.1 update well, so I have some ideas about a couple of these changes that I will add to the relevant PRs. However, I am still orienting myself to the codebase so take whatever I say in those PRs with a grain of salt.

joshRpowell commented 1 month ago

Anyone know how this recent change in Rails https://github.com/rails/rails/commit/d0af407ec0187555cba332943b7d89262fc532bc impacts this Gem?

andynu commented 1 month ago

Josh, Some facts:

What I take from that commit is just that the rails team itself is limiting the scope of what they are actively supporting. It does not preclude other gems continuing to exist and integrate with active-record. But it does put the entire onus of support on those 3rd party gems. Said another way: We're on our own.

On Wed, May 15, 2024 at 10:12 AM Josh Powell @.***> wrote:

Anyone know how this recent change in Rails @.*** https://github.com/rails/rails/commit/d0af407ec0187555cba332943b7d89262fc532bc impacts this Gem?

— Reply to this email directly, view it on GitHub https://github.com/rsim/oracle-enhanced/issues/2357#issuecomment-2112662188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAONGJJLFKVIBNXCV6QHJDZCNULDAVCNFSM6AAAAABB3K7GNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSGY3DEMJYHA . You are receiving this because you were mentioned.Message ID: @.***>

mohits commented 1 month ago

I remember the discussion that support will be provided officially by Rails core for the major supported OSS databases. The discussion was in the context of DB2 support and is at this link: https://github.com/rails/rails/issues/50537

In fact, this gem was specifically mentioned in the discussion. I read it as meaning that Rails core will officially support only those adapters but the community is welcome to add support for others and yes, the onus is on them and their users. However, I have no doubt that changes could be upstreamed to Rails if it were broadly applicable.

jacobat commented 1 month ago

@yahonda Are you aware of anyone working on providing a Rails 7.1 compatible version beyond what's mentioned in this thread? Are you still working on this adapter or do we need to find new maintainer(s)?

yahonda commented 1 month ago

Sorry for my late update. I still have some plan to support Oracle enhanced adapter compatible with Rails 7.1. That will take some more time.

hss-mateus commented 3 days ago

2384 have all the patches mentioned above and a couple of more things

Unfortunatelly I don't have time to test it with different scenarios than a simple model