Are there any good examples of modelling inheritance with DBIx::Class? Thanks,
________________________________ From: Oleg Pronin [mailto:[email protected]] 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 <[email protected]<mailto:[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<http://irc.perl.org#dbix-class> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected] -------------------------------------------------------- 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/[email protected]
