that depends on what u mean

2009/1/20 Howe, Tom (IDEAS PRACTICE AREAS) <tom.h...@morganstanley.com>

>  Are there any good examples of modelling inheritance with DBIx::Class?
> Thanks,
>
>
>  ------------------------------
> *From:* Oleg Pronin [mailto:syber....@gmail.com]
> *Sent:* 20 January 2009 15:11
> *To:* DBIx::Class user and developer list
> *Subject:* Re: [Dbix-class] join problem ( change alias for table )
>
> The best way is to use quote_char
>
> In your MyDB.pm Model:
>
> __PACKAGE__->config(
>     schema_class => ...
>     connect_info => [
>         ...,
>         {
>             quote_char => q{"},
>             name_sep   => q{.},
>         },
>     ],
> );
>
> But you will still in trouble when writing
>
> order_by => 'user DESC'
> because of bug in SQL Abstarct, you will get  ORDER BY "user DESC"
>
> the workaround is to write
> order_by => \' "user" DESC',
> or
> order_by => \'me.user DESC',
>
>
>
> 2009/1/20 ivan <i...@price.ru>
>
>> my $s =  $c->model('MyDB');
>> my $result = $s ->resultset('Client') -> search(
>> { 'id' => $id },
>> join =>  [qw/ user /],
>> );
>>
>> Result SQL:
>>
>> SELECT COUNT( * ) FROM client me LEFT OUTER JOIN users user ON (
>> user.user_id = me.user_id ) WHERE ( id = ? )
>>
>> But 'user' - it is PostgreSQL reserve word.
>>
>>
>> can I change alias for table users ?
>>
>> _______________________________________________
>> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>> IRC: irc.perl.org#dbix-class
>> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>> Searchable Archive:
>> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>>
>
>  ------------------------------
>
> 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.
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to