[Dbix-class] Defining storage in schema

Matt S Trout dbix-class at trout.me.uk
Fri Jan 13 18:08:11 CET 2006


On Thu, Jan 12, 2006 at 02:25:57PM -0800, Alan Humphrey wrote:
> 
> What are you trying to achieve here? What does NoBindStorage *do*?
> 
> NoBindStorage overrides the _execute method of DBIx::Class::Storage::DBI.
> I'm using FreeTDS via DBI:Sybase to access a MSSQL database.  FreeTDS
> doesn't support placeholders/bind variables so I have to swap out the bind
> variables before $self->sth($sql) gets called.

Ahh, one way of doing it. Last time I was in this situation I did a somewhat
hacked-up DBD::Sybase that provided that facility. Left it behind at that
$ork though, although I believe it's still in production :)
 
> I'm still testing, but so far so good.
> 
> DBIx::Class::DB provides a storage method to let you set the storage
> backend.  I guess my question boils down do what's the best way to access
> that method in my DB class?

Hmm. against 0.04, $db_class->storage($storage) should work; as of 0.05 that
*should* still work but the recommended approach will be to set storage_type
on your Schema.

DBIx::Class::DB was really just a shim to make CDBI-style (i.e. class-based)
stuff finished until I got Schema up to scratch - as of 0.05 it won't be
used unless you specifically load the component (Schema->compose_connection
won't use DB anymore)

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list