I am trying to convert some raw DBI calls to DBIx :: Class. I sometimes come across something like:
UPDATE 'foo' SET bar = bar + 1 WHERE ...
Is there a way for DBIx :: Class to execute just such a query? I do not want to do something like:
$row->update({ bar => $row->bar() + 1 });
because there is a race condition if several processes try to do the same.
I could get around this with some database-level locking, but it seems worse to me than just using the original query. Basically, I just want to know if there is a clean way to use DBIC for this, or if I just keep using raw DBI calls here.
source share