jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
462 stars 386 forks source link

Feature: Support PG arrays/dictionaries in Rails 4 #338

Closed jcoleman closed 11 years ago

jcoleman commented 11 years ago

As of Rails 4 (now in beta), Active Record now natively supports Postgres arrays and dictionaries. The JDBC adaptor needs that support ported.

kares commented 11 years ago

yeah there's quite a bit more than just arrays/dicts in 4 (json, hstore, ltree types) - it shall come, thanks

alno commented 11 years ago

I'm trying to port this support in my fork (because it's strongly required in current project), but direct way leads to a lot of code duplication between AR4 and jdbc adapter.

Are there any ways to reduce this duplication?

Currently I may suppose only:

kares commented 11 years ago

no there's not unfortunately - I do have some work on this as well locally - I'm doing it commit by commit (incl. tests) AR does not really care about AR-JDBC - sharing and re-use would be possible if they were one code-base ... or our code-base would have been rewritten somehow to use everything from native adapters and override/replace the parts that won't work - which I'm not really into since it's probably very time consuming esp. with a bunch of adapters + requires constantly monitoring AR changes (also support for multiple AR versions would complicate this further)

jcoleman commented 11 years ago

@kares: Would it be worth interacting with the core team to see if they'd be willing to make AR MRI/JRuby native itself? I mean, not that we'd ask them to write the code, but whether they'd be willing to merge that kind of support in if it were written?

kares commented 11 years ago

@jcoleman I'm really concentrating on GTD on AR-JDBC - I'm doing this instead of (payed) work thus I'm low on time. on the other hand feel free to bring it on if you'd like to and you might say the current most active maintainer(s) (a.k.a. myself :)) is supporting the idea - of an almost complete refactoring of the code to enable more sharing ...

but this all goes a bit further since we have adapters they do not have in AR thus they need to be adopted by someone else (most likley authors of the native adapters such as ar-slqserver-adapter) + even if they do support JRuby (e.g. oracle-enhanced) they might not support all use cases we do such as JNDI connections thus this really needs some dedication not just chit-chat and good will :)

I remember chatting about it a while back on #jruby with @headius and he actually brought it up himself ...

joevandyk commented 11 years ago

Anyone have a branch of activerecord-jdbc-adapter that supports postgresql arrays? Would love to try it.

kares commented 11 years ago

our master now handles (new) Postgres types - please test it out and report separate issues per (not-working) type. please also note that a recent AR from Rails master is required since for 4.0 we depend on some APIs that got changed/updated not that long ago (AR-JDBC's Postgres adapter certainly won't work wit the beta1 release) ...

kares commented 11 years ago

... a second beta 1.3.0.beta2 is out please test and report (in case there are issues) if you can, thx!