[Dbix-class] Issue with DBIx::Class::TimeStamp
Bernhard Graf
dbic3 at augensalat.de
Sat Sep 6 17:49:56 BST 2008
Hello list and hello J. Shirley,
I wanted to use DBIx::Class::TimeStamp because I like the simplicity.
There is only one problem:
By default, when you call update on a row object where none of the
columns actually changed, no SQL-UPDATE is executed - very clever.
Now with DBIx::Class::TimeStamp and at least one field with {
set_on_update => 1 } the SQL-UPDATE is executed in the above case
setting those set_on_update-fields only. Not so clever IMHO.
Of course I could check the row object first, but I like to keep my
application code as clear and simple as possible.
The actual application is some sort of RSS aggregator. It calls
update_or_create() for each RSS item. ATM every item from the RSS feed
updates the set_on_update-field of the corresponding row even if no
item has changed.
Wouldn't it be better if $self->is_changed is consulted first in
DBIx::Class::TimeStamp?
--
Bernhard Graf
More information about the DBIx-Class
mailing list