Re: [Dbix-class] 0.08103 - call for testers!

2009-05-18 Thread David Ihnen
Peter Rabbitson wrote: Greetings, The next release of DBIC will have a number of exciting improvements, among them proper ->count ->update and ->delete of any resultset, regardless of it's complexity (join, group_by, paging, etc.) While all of these improvements are logical extensions of the aw

[Dbix-class] [ANNOUNCE] DBIx::Class::Preview

2009-05-18 Thread luke saunders
I've just released DBIx::Class::Preview which enables you to redirect reads and writes to a separate table when preview mode is active on your DBIC schema. Good for making changes and previewing them before publishing those changes to the main table. http://search.cpan.org/~lsaunders/DBIx-Class-Pr

[Dbix-class] 0.08103 - call for testers!

2009-05-18 Thread Peter Rabbitson
Greetings, The next release of DBIC will have a number of exciting improvements, among them proper ->count ->update and ->delete of any resultset, regardless of it's complexity (join, group_by, paging, etc.) While all of these improvements are logical extensions of the awesome as_query() feature,

RE: [Dbix-class] Increment MySQL field

2009-05-18 Thread Byron Young
From: Андрей Костенко [mailto:and...@kostenko.name] Sent: Monday, May 18, 2009 11:38 AM To: DBIx::Class user and developer list Subject: Re: [Dbix-class] Increment MySQL field It is bad. If my program have more than one thread: first thread: SELECT balance FROM somewhere ( returns 150 ) second

Re: [Dbix-class] Increment MySQL field

2009-05-18 Thread Андрей Костенко
It is bad. If my program have more than one thread: *first thread*: SELECT balance FROM somewhere ( returns 150 ) *second thread* (which works at the same time): SELECT balance FROM somewhere ( returns 150 ) *first thread*: UPDATE something SET balance=250; *second thread*: UPDATE something SET ba

RE: [Dbix-class] Increment MySQL field

2009-05-18 Thread Byron Young
Ben Vinnerd wrote on 2009-05-15: > Hey, > > I have the following SQL to increment a field by 100: > > update account set balance = balance + 100 > > I can increment a field with DBIC, like so: > > $account->update({balance => \'balance + 100'}); > > Is there a better/cleaner way of doing this

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Peter Rabbitson
Chris Cole wrote: > Peter Rabbitson wrote: >> Chris Cole wrote: >>> my $new_album = $schema->resultset('Album')->create({ >>> title => 'Wish You Were Here', >>> artist => 'Pink Floyd' >>> }); >>> >>> Now you can add data to the new record: >>> >>> $new_album->label('Capitol'); >>>

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Chris Cole
Peter Rabbitson wrote: > Chris Cole wrote: >> my $new_album = $schema->resultset('Album')->create({ >> title => 'Wish You Were Here', >> artist => 'Pink Floyd' >> }); >> >> Now you can add data to the new record: >> >> $new_album->label('Capitol'); >> $new_album->year('1975'); >>

[Dbix-class] SQL::Abstract -nest modifier

2009-05-18 Thread Peter Rabbitson
Hi everyone, With SQLA 2.0 coming closer to reality, there was a substantial effort to clear up and disambiguate the SQLA 1.x API. One of the remaining quirks is the -nest operator, which was introduced in version 1.18. The examples provided in the documentation make no sense from a usability poin

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Peter Rabbitson
Chris Cole wrote: > Peter Rabbitson wrote: >> Chris Cole wrote: >>> To clarify. With autocommit 'off', this code: >>> my $species = $schema->resultset("Species"); >>> >>> $species->populate([ >>>{ short_name => $shortName, >>> full_name => $longName, >>> common_name => $commonName } >

[Dbix-class] Trying to add value restrictions in my relationship JOIN

2009-05-18 Thread Geoffrey P Waigh
Hello, I have several tables in the following form: definition_table: (key1, key2, serial, date_active, date_inactive, meta1, meta2) value_table: (key1, keyA, key2, serial, date_active, date_inactive, data1,data2) The primary key for the definition_table is (key1, key2, serialD) where serial is

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Chris Cole
Peter Rabbitson wrote: > Chris Cole wrote: >> To clarify. With autocommit 'off', this code: >> my $species = $schema->resultset("Species"); >> >> $species->populate([ >>{ short_name => $shortName, >> full_name => $longName, >> common_name => $commonName } >> ]); >> >> $species->update

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Peter Rabbitson
Chris Cole wrote: > Peter Rabbitson wrote: >> Chris Cole wrote: >>> Hi, >>> >>> Given this schema: > > [snip] >>> and this code: >>> my $schema = DB::Schema->connect(stuff); >>> >>> my $species = $schema->resultset("Species"); >>> >>> $species->populate([ >>>{ short_name => $shortName, >>>

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Chris Cole
Louis Erickson wrote: > On Thu, 14 May 2009, Chris Cole wrote: > > > >> Why does it work fine when I have Autocommit 'on', but get the following >> error with Autocommit 'off': > > I'm surprised no one else has replied. This bit me too when I first > started with DBIC. It seemed backwards to

Re: [Dbix-class] Problem with populate() and commits?

2009-05-18 Thread Chris Cole
Peter Rabbitson wrote: > Chris Cole wrote: >> Hi, >> >> Given this schema: [snip] >> and this code: >> my $schema = DB::Schema->connect(stuff); >> >> my $species = $schema->resultset("Species"); >> >> $species->populate([ >>{ short_name => $shortName, >> full_name => $longName, >> co