I'm trying to convert some raw DBI calls to DBIx::Class. I occasionally run across something like:
UPDATE 'foo' SET bar = bar + 1 WHERE ...
Is there way to do have DBIx::Class execute exactly this kind of query? I don't want to do something like:
$row->update({ bar => $row->bar() + 1 });
because there's a race condition there if multiple processes are trying to do the same thing.
I could get around that with some kind of locking at the database level, but that seems worse to me than just using the original query. Basically I just want to know if there's a clean way of using DBIC to do this or if I should just continue to use raw DBI calls here.