I am figuring out how to import bulk CSV data where each input row will 
result in a created record in one table with one or more associated records 
in another table. I'd like to continue using Dataset#import but the 
associated records need to reference the primary key of the "parent" 
records. I think I can use multiple calls to #import but will need the 
primary keys, which are returned when using the :return option, to populate 
the foreign key field of the "child" records. Can I rely on the primary 
keys returned from #import being in the same order as the input rows passed 
to #import? My plan is to match the returned primary keys with the input 
CSV rows to then call #import again to insert the associated rows. Do you 
see any pitfalls or better approaches to this scenario? Thanks!

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to