abrandoned / activerecord-jdbcvertica-adapter

MIT License
3 stars 5 forks source link

Rails 5.1+ Compatibility #8

Open selfnewlin opened 5 years ago

selfnewlin commented 5 years ago

The activerecord-jdbc-adapter gem for rails 5.1+ has some substantial changes with how they structure the adapters and this gem would need to be updated to work with newer versions of Rails.

mrdeadsake commented 5 years ago

I have no idea why i was logged is as newlin... But that issue was created by me

¯\(ツ)

mrdeadsake commented 5 years ago

crossposted from another issue i wrote up

After attempting to update to update to rails 5. I've found an incompatibility issue with the gem:

AR JDBC Adapter and the newest ActiveRecord 5.1.

The core of the issue is found in this open issue for that gem ARJBDC adapter issue. Where they state that only a few database types are currently supported. Not on that list is Vertica. Which means we would need to add that ability ourselves.

From what I've been able to hunt down the specific errors are:

  1. The arjbdc abstract/core adapter jdbc_connection initializes a connection with 4 arguments instead of the 3 that AR 5 now uses.
  2. Overriding the method to create a connection with 3 args works, but then there are additional errors getting thrown by arjdbc/abstract/quoting#68 lookup_cast_type(column.sql_type). The column.sql_type method is failing due to undefined method sql_type for #. I've been able to make this functionally work by rescuing the first attempt to call this method and trying a second. (No idea why it works but it does)

My best guess at a viable solution for this would be to update our vertica adapter gem to provide the functionality we need for AR 5 and ARJDBC 51.2.

However, my knowledge of AR and JDBC aren't superb so i'm hoping to enlist help from some people who do have the know-how.