ConsultingMD / activerecord5-redshift-adapter

Other
45 stars 155 forks source link

Support for Rails 6 ? #26

Closed kwent closed 5 years ago

kwent commented 5 years ago

Hi,

https://rubygems.org/gems/rails/versions/6.0.0 is out and i was wondering if this library should support it ?

Regards

booleanbetrayal commented 5 years ago

Also looking for a suitable Redshift adapter for ActiveRecord 6.0.0. Does anyone know if there's been any effort to producing a compatible adapter yet? Blocked on upgrading atm.

booleanbetrayal commented 5 years ago

This looks promising - https://github.com/iamdbc/activerecord6-redshift-adapter

kwent commented 5 years ago

Seeing

undefined method `preparable=' for #<Arel::Visitors::PostgreSQL:0x00007f6080954d80>

with https://github.com/iamdbc/activerecord6-redshift-adapter

kwent commented 5 years ago

I actually made it work with that fork: https://github.com/kwent/activerecord6-redshift-adapter and tested in a production environment 🎉

booleanbetrayal commented 5 years ago

@kwent - I'm still running into adapter compatibility issues that were exposed when attempting to use Rails migrator tasks against our Redshift DB. I've been fleshing them out as I go here:

https://github.com/booleanbetrayal/activerecord6-redshift-adapter/tree/more_activerecord-6_fixes

Currently hitting the following issue though, writing timestamps:

PG::InvalidDatetimeFormat: ERROR:  invalid input syntax for type timestamp: "#<ActiveRecord::Relation::QueryAttribute:0x00007f9d6bcb1aa0>"
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift_adapter.rb:466:in `async_exec'
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift_adapter.rb:466:in `block in exec_no_cache'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:707:in `block (2 levels) in log'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:706:in `block in log'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activesupport-6.0.0/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:697:in `log'
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift_adapter.rb:466:in `exec_no_cache'
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift_adapter.rb:456:in `execute_and_clear'
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift/database_statements.rb:159:in `exec_query'
~/Development/GitHub-Forks/activerecord6-redshift-adapter/lib/active_record/connection_adapters/redshift/database_statements.rb:191:in `exec_insert'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:162:in `insert'
~/.rvm/gems/ruby-2.6.3@back_royal/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `insert'
booleanbetrayal commented 5 years ago

Actually, I just fixed this issue and a few others and opened a pull request to your repo @kwent . Let me know if you'd rather not maintain it, and I can stand a repo up from a fork of this one ^.

https://github.com/kwent/activerecord6-redshift-adapter/pull/1

kwent commented 5 years ago

Closing this issue since we are now going to iterate on https://github.com/kwent/activerecord6-redshift-adapter