digital-fabric / extralite

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

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

Closed noteflakes closed 6 months ago

noteflakes commented 6 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