On Friday, October 4, 2013 2:36:33 PM UTC-7, Rodrigo Rosenfeld Rosas wrote:
>
> It would be great if this would work the way most would expect it to 
> behave:
>
> ids = MyModel.dataset.returning(:id).import [:a, :b], [[1, 2], [3, 4]] # 
> => [id1, id2]
>
> Could you please consider this for some future version?
>
>
Looks like it isn't currently documented (I'll fix that), but you can use 
the :return=>:primary_key option to do so starting in Sequel 3.31.0.

Most people using #import/#multi_insert probably don't care about the 
inserted ids, and using the option can make things slower, which is why it 
doesn't operate that way by default.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to