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 <[email protected]>
> 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/[email protected]
>
_______________________________________________
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/[email protected]