You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the Extralite API includes a #execute_multi method, that takes an array and executes the same query repeatedly, taking its parameters from each array entry. This can be generalized into a #batch_execute method that can take an array, an enumerable, or a block. Some examples:
q=db.prepare('insert into foo (?, ?, ?)')# Batch execute from an array (existing functionality)data=[[1,2,3],[4,5,6]]q.execute_batch(data)# Batch execute from an Enumerable (by calling #each)data=(1..3).lazy.map{ |i| [i * 10,i * 20,i * 30]}q.execute_batch(data)# Batch execute from blockq.execute_batchdoSTDOUT << "Enter a number: "number=getsifnumber.empty?nilelsenumber=number.to_i[number * 10,number * 20,number * 30]endend
The #execute_multi method can first be an alias to #batch_execute, then be deprecated in a future release.
The text was updated successfully, but these errors were encountered:
Right now, the Extralite API includes a
#execute_multi
method, that takes an array and executes the same query repeatedly, taking its parameters from each array entry. This can be generalized into a#batch_execute
method that can take an array, an enumerable, or a block. Some examples:The
#execute_multi
method can first be an alias to#batch_execute
, then be deprecated in a future release.The text was updated successfully, but these errors were encountered: