Hello, I don't know if is possible do it using this gem, it is the case:
connection = Mysql2::Client.new([...])
Upsert.batch(connection, :pets) do |upsert|
# N times...
upsert.row({:name => 'product1'}, :count => 2)
upsert.row({:name => 'product2'}, :count => 10)
end
I don't wanna only update the count attribute, if the product1 has a count: 1 in the database, I wanna sum the database value with the new value. In this case product1.count became 3(2+1).
Is it possible? Thanks all
Hello, I don't know if is possible do it using this gem, it is the case:
I don't wanna only update the count attribute, if the
product1has acount: 1in the database, I wanna sum the database value with the new value. In this caseproduct1.countbecame 3(2+1).Is it possible? Thanks all