[Dbix-class] can't get PK::Auto with MSSQL thru Sybase - fix?
Christopher H. Laco
claco at chrislaco.com
Tue Sep 5 22:39:14 CEST 2006
Robert Dobbs wrote:
>
>
>>> Hey guess what. This doesn't seem to matter. As a test, I changed line
>> 941
>>> of DBIC:Storage::DBI to do "return $self->dbh->selectrow_array('SELECT
>>> @@IDENTITY')" and it works great. I think the subclassed PK::Auto for
>>> MS-SQL needs to be brought back to life.
>> Be aware, @@IDENTITY can lead to odd things (MSSQL)...
>
> Hey this is pretty weird. DBIx::Class::Storage::DBI::Sybase::MSSQL uses
> @@IDENTITY. So let's just assume that's okay for the moment.
>
> But for some reason, my storage is not a
> DBIx::Class::Storage::DBI::Sybase::MSSQL. Class::C3::calculateMRO yields
> (DBIx::Class::Storage::DBI::Sybase DBIx::Class::Storage::DBI::NoBindVars
> DBIx::Class::Storage::DBI DBIx::Class::AccessorGroup DBIx::Class::Storage
> DBIx::Class DBIx::Class::Componentised Class::Data::Accessor).
>
> That would probably be because my connect info gives no indication that it
> is MSSQL - I am using the FreeTDS sybase driver, and it doesn't need that.
>
> Where do I set storage_type to ::DBI::Sybase::MSSQL?
>
> Mark
In your schema class. It's not really documented in ::Schema, but it's
in the source:
__PACKAGE__->mk_classdata('storage_type' => '::DBI');
I'd assume you can just set it to ::DBI::MSSQL or ::DBI::Sybase::MSSQL
-=Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060905/0ceee6ba/attachment.pgp
More information about the Dbix-class
mailing list