flipp-oss / deimos

Framework to work with Kafka, Avro and ActiveRecord
Other
59 stars 22 forks source link

Use insert_all if on Rails 6 #17

Closed dorner closed 1 year ago

dorner commented 5 years ago

Currently we're using activerecord-import for the DB producer. We should detect if the app is on Rails 6 and use insert_all - this will remove the dependency for activerecord-import for newer apps.

colinmroberts commented 5 years ago

This may have to wait for Rails 6.1 to release. There's a bug that was fixed after 6.0 was out that prevents you from using the primary key as one of the matching criteria.

Fixed here on master: https://github.com/rails/rails/commit/1af44e4aeeb04a6360b5104d8ee7b4a042ef93d8

dorner commented 5 years ago

Sounds good - no rush on this one.

dorner commented 1 year ago

Doesn't look like this supports on_duplicate_key_update, so we can't actually do this.