[Dbix-class] Overriding limit_dialect

Jesper Krogh jesper at krogh.cc
Wed Jan 25 18:25:55 CET 2006


Matt S Trout wrote:
> On Wed, Jan 25, 2006 at 03:38:49PM +0100, Jesper Krogh wrote:
> 
>>hi.
>>
>>I've tried to use DBIx::Class against a DBD::JDBC database (MS SQL Server)
>>and it generally works fine, except that the call to SQL::Abstract::Limit
>>cannot deduce the limit dialect on the remote server.
>>
>>This patch allows to explicit specify the limit dialect in the main
>>connection:
>>
>>__PACKAGE__->connection("dbi:JDBC:hostname=$hostname;port=$port;url=$url",$user,$password,{"limit_dialect"
>>=> "postgresql"});
> 
> 
> Erm. I think there's a way to get the db you're connected to out of a JDBC
> or ODBC handle, but I forget exactly what it is. A patch to do that would be
> wonderful (hint :).

I've submitted a patch for JDBC for that.. get_info()-stuff. Then
SQL::Abstract::Limit need to be patched too. (to match the
get_info-string).

> I don't however see the advantage to your patch over
> 
> __PACKAGE__->connection(...);
> __PACKAGE__->storage->sql_maker->limit_dialect('postgresql');

Thanks.

Jesper

-- 
Jesper Krogh, jesper at krogh.cc




More information about the Dbix-class mailing list