This in order to allow batch executing insert ... returning ... queries.
db.batch_query('insert into foo values (?) returning *', 1..3)
#=>[ {bar: 1}, {bar: 2}, {bar: 3}]
db.batch_query_ary('insert into foo values (?) returning *', 1..3)
#=> [ [1], [2], [3] ]
db.batch_query_single_column('insert into foo values (?) returning bar', 1..3)
#=> [1, 2, 3]
# Can also used with a block:
db.batch_query_single_column('insert into foo values (?) returning bar', 1..3) do |bar|
p bar
end
# 1
# 2
# 3
#=> db
This in order to allow batch executing
insert ... returning ...
queries.