I am trying to use use_cursor with eager,
but use_cursor requires to use each,
which didn't work well with eager. Any advise?

Thanks!

For now, I am doing something like this to
simulate it:

query.use_cursor(:rows_per_fetch => 100).each_slice(100) do |records|
  assocs = Assoication.where(:id => records.map(&:association_id)).all
  records.each do |r|
    r.association = assocs.find{ |a| a.id == r.association_id }
  end
end

It would be great if there's a better way to do this.

p.s. use_cursor:
http://sequel.jeremyevans.net/rdoc-adapters/classes/Sequel/Postgres/Dataset.html#method-i-use_cursor

-- 
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/d/optout.

Reply via email to