Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: DBIx update and simultaneosly modify field

by snoopy (Deacon)
on Jun 26, 2007 at 23:49 UTC ( #623512=note: print w/replies, xml ) Need Help??


in reply to DBIx::Class update and simultaneosly modify field

You can set cdbi autoupdate on an object to enable immediate database updates
$rs->autoupdate(1); $rs->set(field1 => 55, field2 => 'field2+1');
Update: You'll also need to enable the cdbi auto-update facility in your class set-up:
package MyClass; use base qw(DBIx::Class) __PACKAGE__->load_components(qw/CDBICompat::AutoUpdate/); #....

Replies are listed 'Best First'.
Re^2: DBIx update and simultaneosly modify field
by rootcho (Pilgrim) on Jun 27, 2007 at 18:22 UTC
    my mine concern is not does it do autoupdate or not, but will it generate 1 or 2 queries ? thanx
    I think there was some way to debug this !!! DBIx::Storage or something..hmmm let me check

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://623512]
help
Chatterbox?
[Corion]: Greetings from the German Perl Workshop ;)
[1nickt]: Isn't it YAPC::NA too?
[Corion]: Yes, but I think there's not that much overlap in our audiences ;))
[1nickt]: Sheesh, I would have thought they would be satellite-linked somehow!
[1nickt]: Who's writing all the code this week, then?

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2017-06-27 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (613 votes). Check out past polls.