Title: Message
Thanks Luke and Brian.
 
I  know that the SQL below works with MySQL v4 so I'd like to be able to issue it directly. Is it possible to somehow pass the raw SQL and get  a DBIx result set returned?
 
Dan
 
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of luke saunders
Sent: Wednesday, 17 May 2006 00:04
To: dbix-class@lists.rawmode.org
Subject: Re: [Dbix-class] Subquery question

On 5/16/06, Dan Horne <[EMAIL PROTECTED] > wrote:
Hi All

I'm trying to figure out how to perform subqueries with DBIx::Class. For
example, I want to find all the roles that user 2 hasn't been assigned.
The standard SQL is

select role_id, display_name
from   app_role a
where  not exists
    (select 1
     from   user_role u
     where  u.user_id = 2
     and    u.role_id = a.role_id);

What would the DBIx::Class equivalent be?

Regards

Dan Horne

Hi Dan,

Sadly subselects like this aren't possible with DBIC at the moment.

It's definitely on the TODO list, I guess Matt will be able to tell you roughly when it'll be ready. Until then you'll have to find a way of doing it that doesn't require the subselect.

Cheers,
Luke.

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/

Reply via email to