Re: [Dbix-class] how to use a complex query in DBIx::Class

2006-12-29 Thread Matt LeBlanc
On 12/29/06, Jess Robinson <[EMAIL PROTECTED]> wrote: On Tue, 26 Dec 2006, Matt LeBlanc wrote: > On 12/26/06, Jess Robinson <[EMAIL PROTECTED]> wrote: >> $schema->resultset('boards')->search({ >> 'hiddenboards.userId' => 3, >> 'me.active' => 1, >> }, { >> 'join' => 'hiddenboards'

Re: [Dbix-class] how to avoid "select =>... as => ..." syntax with simple but long queries e.g. M fields from N tables with decodes and sql-date operations

2006-12-29 Thread Jess Robinson
On Wed, 27 Dec 2006, Igor Longagnani wrote: Hi, a newbie is here again :) I come from a DBIx::Class RTFM session and I am a little sad because it doesnt seem helpful with simple stuff like select T1.field1,T1.field2,T2,field3,...,TN.fieldM --- (M fields from N tables) from

Re: [Dbix-class] Subquerys

2006-12-29 Thread Jess Robinson
On Wed, 27 Dec 2006, Moritz Onken wrote: How do I write this query in dbix-class syntax? DELETE FROM chat WHERE ( chat.ID NOT IN ( SELECT chat.ID FROM chat ORDER BY chat.time DESC LIMIT 0,20 )) thanks Currently, by doing something like: ->search({ -and => [1, \'chat.ID

Re: [Dbix-class] how to execute stored procedures in DBIx::Class

2006-12-29 Thread Jess Robinson
On Tue, 26 Dec 2006, Wan wrote: In MySQL 5.0.x, I have created a procedure named boardslist, like this CREATE PROCEDURE boardslist (IN uId INT) BEGIN SELECT boards.*, hiddenboards.userId IS NOT NULL AS hidden FROM boards LEFT JOIN hiddenboards ON hiddenboards.userId = uId AND hiddenboards.boa

Re: [Dbix-class] how to use a complex query in DBIx::Class

2006-12-29 Thread Jess Robinson
On Tue, 26 Dec 2006, Matt LeBlanc wrote: On 12/26/06, Jess Robinson <[EMAIL PROTECTED]> wrote: $schema->resultset('boards')->search({ 'hiddenboards.userId' => 3, 'me.active' => 1, }, { 'join' => 'hiddenboards', '+select' => [ 'hiddenboards.userId' ], '+as' => [ 'hidden'

Re: [Dbix-class] Re: how to use a complex query in DBIx::Class

2006-12-29 Thread Jess Robinson
On Wed, 27 Dec 2006, A. Pagaltzis wrote: * Brandon Black <[EMAIL PROTECTED]> [2006-12-27 01:05]: She was referring to the odd use of selecting the boolean NOT NULL of what seems to be the pk in a foreign table being joined Ah, I didnÿÿt notice the condition in the ON clause (which should ha

[Dbix-class] [ANN] DBIx::Class::DigestColumns -- major flaws in CPAN -- corrected in SVN

2006-12-29 Thread Guillermo Roditi
TO: Everyone using DigestColumns The CPAN version has what is considered to be, at the very least, wildly inefficient behavior, and the worst data corrupting behavior. The CPAN version will automatically digest the marked columns on _every_ INSERT and UPDATE operation making it unsuitable for th

Re: [Dbix-class] A problem with Postgres schemas

2006-12-29 Thread Rolf Schaufelberger
On Friday 29 December 2006 15:29, John Napiorkowski wrote: > --- Rolf Schaufelberger <[EMAIL PROTECTED]> wrote: > > On Thursday 28 December 2006 22:06, Kevin Esteb > > > > wrote: > > > I new to DBIx::Class, so please bear with me. > > > > > > I am running RHEL4 and have a postgres database > > > >

Re: [Dbix-class] Deflating a date

2006-12-29 Thread Nick Edwards
Hi Tobias, Thanks for this. On Thu, 2006-12-28 at 15:23 +0100, Tobias Kremer wrote: > Hi Nick, > > > my $article = $c->model('Pacdb::File::Article')->find_or_create(id => > > $id); > > $article->set_column(date => $params{date}); # format dd/mm/ > > $article->update; > > When setting your d

Re: [Dbix-class] A problem with Postgres schemas

2006-12-29 Thread John Napiorkowski
--- Rolf Schaufelberger <[EMAIL PROTECTED]> wrote: > On Thursday 28 December 2006 22:06, Kevin Esteb > wrote: > > I new to DBIx::Class, so please bear with me. > > > > I am running RHEL4 and have a postgres database > with a schema named > > "analog". The DBIx::Class modules are the latest > and

Re: [Dbix-class] A problem with Postgres schemas

2006-12-29 Thread Rolf Schaufelberger
On Thursday 28 December 2006 22:06, Kevin Esteb wrote: > I new to DBIx::Class, so please bear with me. > > I am running RHEL4 and have a postgres database with a schema named > "analog". The DBIx::Class modules are the latest and greatest from CPAN, > so is the DBD and the DBI for postgres. When I