activerecord-import icon indicating copy to clipboard operation
activerecord-import copied to clipboard

Support returning `ids` for mysql too

Open fmichaut-diff opened this issue 1 year ago • 1 comments

According to this: https://stackoverflow.com/questions/7333524/how-can-i-insert-many-rows-into-a-mysql-table-and-return-the-new-ids It is possible to compute the inserted IDs on mysql and returning in the ids field of the result like it is done for Postgres.

It would be a great improvement as it is very useful to be able to get the list of records that just got inserted and there is no easy way to do it manually: the only way is to manually loop on the bulk imported data and .find_by each record

fmichaut-diff avatar Aug 30 '22 19:08 fmichaut-diff

That has been discussed here: https://github.com/zdennis/activerecord-import/pull/279

jkowens avatar Aug 30 '22 20:08 jkowens