digital-fabric / extralite

Ruby on SQLite
http://www.rubydoc.info/gems/extralite
MIT License
255 stars 8 forks source link

Allow creating a copy of a `Query` instance #51

Closed noteflakes closed 11 months ago

noteflakes commented 11 months ago

Allow copying queries. This may facilitate working with queries in multiple threads:

query = db.prepare('select * from foo where bar = ?')
results = Queue.new
workers = (1..10).map do |i|
  Thread.new
    results << query.clone.to_a(i)
  end
end