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

Remove unused Arel visitors in the code base #38946

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Apr 14, 2020

This removes ibm_db, informix, mssql, oracle, and oracle12 Arel visitors
which are not used in the code base.

Actually oracle and oracle12 visitors are used at oracle-enhanced
adapter, but now I think that those visitors should be in the adapter's
repo like sqlserver adapter and the dedicated Arel visitor
(https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/lib/arel/visitors/sqlserver.rb),
otherwise it is hard to find a bug and review PRs for the oracle
visitors (e.g. #35838, #37646), since we don't have knowledge and
environment enough for Oracle.

cc @yahonda

Copy link
Member

@rafaelfranca rafaelfranca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arel is private API, but I think this needs a changelog entry, so the adapter developers know about that.

@simi
Copy link
Contributor

simi commented Apr 14, 2020

I understand and welcome this change, but it would be really nice to actually get in sync with adapter authors and ensure they could prepare new release including visitor before this is released as well on Rails side. Also temporarily it would be developer friendly to raise error on request to use one of those removed visitors.

@rafaelfranca
Copy link
Member

It is good to alert the adapters authors but I don't think we should be waiting them to respond. Even more that we don't know all of them. This is a project decision, like any other API we provide. Specially arel as it is private API.

I don't think an error is necessary if all actually maintained adapters change their code, which will be required anyway.

We already alerted the oracle adapter maintainers, now we need to alert the mssql adapter https://github.com/rails-sqlserver/activerecord-sqlserver-adapter

@kamipo
Copy link
Member Author

kamipo commented Apr 14, 2020

Note that sqlserver adapter is not using Arel bundled mssql visiter but using its own visitor.

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/lib/arel/visitors/sqlserver.rb

@yahonda
Copy link
Member

yahonda commented Apr 14, 2020

I am fine this change, actually, I need some time to migrate Arel code into Oracle enhanced adapter. It may take couple of weeks.

@simi
Copy link
Contributor

simi commented Apr 15, 2020

Anyone any idea about ibm_db and informix usage?

@simi
Copy link
Contributor

simi commented Apr 15, 2020

I have opened issues at both informix and ibm_db related repos I found.

ibmdb/ruby-ibmdb#98
santana/activerecord-informix-adapter#6

This removes ibm_db, informix, mssql, oracle, and oracle12 Arel visitors
which are not used in the code base.

Actually oracle and oracle12 visitors are used at oracle-enhanced
adapter, but now I think that those visitors should be in the adapter's
repo like sqlserver adapter and the dedicated Arel visitor
(https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/lib/arel/visitors/sqlserver.rb),
otherwise it is hard to find a bug and review PRs for the oracle
visitors (e.g. rails#35838, rails#37646), since we don't have knowledge and
environment enough for Oracle.
@kamipo kamipo merged commit 943f1ea into rails:master Apr 15, 2020
@kamipo kamipo deleted the remove_unused_visitors branch April 15, 2020 09:51
@yahonda
Copy link
Member

yahonda commented Apr 15, 2020

FYI Oracle enhanced adapter supports this change rsim/oracle-enhanced#2002

kamipo added a commit to kamipo/rails that referenced this pull request Apr 26, 2020
`in_clause_length` was added at c5a284f to address to Oracle IN clause
length limitation.

Now `in_clause_length` is entirely integrated in Arel visitor since
rails#35838 and rails#36074.

Since Oracle visitors are the only code that rely on `in_clause_length`.
so I'd like to remove that from Rails code base, like has removed Oracle
visitors (rails#38946).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants