Hello,
To do an insert with Class::DBI, you can simply do:
my $object = Object::DB->insert({ a => 1, b => 2, c => 3, ...});
But there is no such thing for update. The best I could come up with is selecting the record first then updating it:
my $object = Object::DB->retrieve($id);
my $object->set( a => 1, b => 2, c => 3, ...};
$object->update;
This is not efficient since I have to do a SELECT first, and then an UPDATE instead of just one UPDATE.
Is there a better way to do this with Class::DBI? I don't want to do 42 $object->a(1), $object->b(2), etc., $object->update;