<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=937522212-16052006><FONT face=Arial color=#0000ff size=2>Thanks 
Luke and Brian.</FONT></SPAN></DIV>
<DIV><SPAN class=937522212-16052006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV><SPAN class=937522212-16052006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>
<DIV></DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff>I<SPAN 
class=937522212-16052006>&nbsp; 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&nbsp; a DBIx result set 
returned?</SPAN></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN 
class=937522212-16052006></SPAN></FONT></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN 
class=937522212-16052006>Dan</SPAN></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN 
class=937522212-16052006></SPAN></FONT></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN 
class=937522212-16052006></SPAN></FONT></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Tahoma><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN 
class=937522212-16052006>&nbsp;</SPAN></FONT></FONT>-----Original 
Message-----<BR><B>From:</B> dbix-class-bounces@lists.rawmode.org 
[mailto:dbix-class-bounces@lists.rawmode.org] <B>On Behalf Of </B>luke 
saunders<BR><B>Sent:</B> Wednesday, 17 May 2006 00:04<BR><B>To:</B> 
dbix-class@lists.rawmode.org<BR><B>Subject:</B> Re: [Dbix-class] Subquery 
question<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">On 
  5/16/06, <B class=gmail_sendername>Dan Horne</B> &lt;<A 
  onclick="return top.js.OpenExtLink(window,event,this)" 
  href="mailto:dan.horne@redbone.co.nz" target=_blank>dan.horne@redbone.co.nz 
  </A>&gt; wrote:
  <DIV><SPAN class=gmail_quote></SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi 
    All<BR><BR>I'm trying to figure out how to perform subqueries with 
    DBIx::Class. For <BR>example, I want to find all the roles that user 2 
    hasn't been assigned.<BR>The standard SQL is<BR><BR>select role_id, 
    display_name<BR>from&nbsp;&nbsp; app_role a<BR>where&nbsp;&nbsp;not 
    exists<BR>&nbsp;&nbsp;&nbsp;&nbsp;(select 1<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    from&nbsp;&nbsp; user_role u <BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    where&nbsp;&nbsp;u.user_id = 2<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
    and&nbsp;&nbsp;&nbsp;&nbsp;u.role_id = a.role_id);<BR><BR>What would the 
    DBIx::Class equivalent be?<BR><BR>Regards<BR><BR>Dan Horne</BLOCKQUOTE>
  <DIV><BR>Hi Dan,<BR><BR>Sadly subselects like this aren't possible with DBIC 
  at the moment. <BR><BR>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.<BR><BR>Cheers,<BR>Luke.</DIV></DIV><BR></BLOCKQUOTE></BODY></HTML>