<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">



<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY >
<DIV>
<DIV dir=ltr align=left><SPAN class=639523616-20012009><FONT face=Arial 
color=#0000ff size=2>Are there any good examples of modelling inheritance with 
DBIx::Class?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=639523616-20012009>Thanks,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=639523616-20012009></SPAN></FONT>&nbsp;</DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Oleg Pronin [mailto:syber.rus@gmail.com] 
  <BR><B>Sent:</B> 20 January 2009 15:11<BR><B>To:</B> DBIx::Class user and 
  developer list<BR><B>Subject:</B> Re: [Dbix-class] join problem ( change alias 
  for table )<BR></FONT><BR></DIV>
  <DIV></DIV>The best way is to use quote_char<BR><BR>In your MyDB.pm 
  Model:<BR><BR>__PACKAGE__-&gt;config(<BR>&nbsp;&nbsp;&nbsp; schema_class =&gt; 
  ...<BR>&nbsp;&nbsp;&nbsp; connect_info =&gt; 
  [<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ...,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  quote_char =&gt; 
  q{"},<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  name_sep&nbsp;&nbsp; =&gt; q{.},<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  },<BR>&nbsp;&nbsp;&nbsp; ],<BR>);<BR><BR>But you will still in trouble when 
  writing<BR><BR>order_by =&gt; 'user DESC'<BR>because of bug in SQL Abstarct, 
  you will get&nbsp; ORDER BY "user DESC"<BR><BR>the workaround is to write 
  <BR>order_by =&gt; \' "user" DESC',<BR>or<BR>order_by =&gt; \'me.user 
  DESC',<BR><BR><BR><BR>
  <DIV class=gmail_quote>2009/1/20 ivan <SPAN dir=ltr>&lt;<A 
  href="mailto:ivan@price.ru">ivan@price.ru</A>&gt;</SPAN><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">my 
    $s = &nbsp;$c-&gt;model('MyDB');<BR>my $result = $s -&gt;resultset('Client') 
    -&gt; search(<BR>{ 'id' =&gt; $id },<BR>join =&gt; &nbsp;[qw/ user 
    /],<BR>);<BR><BR>Result SQL:<BR><BR>SELECT COUNT( * ) FROM client me LEFT 
    OUTER JOIN users user ON (<BR>user.user_id = me.user_id ) WHERE ( id = ? 
    )<BR><BR>But 'user' - it is PostgreSQL reserve word.<BR><BR><BR>can I change 
    alias for table users 
    ?<BR><BR>_______________________________________________<BR>List: <A 
    href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" 
    target=_blank>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</A><BR>IRC: 
    <A href="http://irc.perl.org#dbix-class" 
    target=_blank>irc.perl.org#dbix-class</A><BR>SVN: <A 
    href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" 
    target=_blank>http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</A><BR>Searchable 
    Archive: <A 
    href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" 
    target=_blank>http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</A><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT FACE="Arial" COLOR="gray" SIZE="1">NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.</FONT></SPAN></P>
<DIV>
</DIV></BODY></HTML>