[Dbix-class] Defining storage in schema

Alan Humphrey alan.humphrey at comcast.net
Thu Jan 12 17:35:35 CET 2006


I'd like to override the storage used by each of the classes in my schema.
This is what I've got now in my DB class:

 

BirdWeb::Admin::Model::BirdWebSchema->compose_connection( __PACKAGE__,
@conn_info );

 

my $store = BirdWeb::Admin::Model::NoBindStorage->new();

$store->connect_info( \@conn_info );

 

my $classes = __PACKAGE__->classes();

foreach my $class (keys ( %{$classes} ) ) {

      ${$classes}{$class}->storage( $store );

}

 

Is this the best way to go or is there a more straightforward way that I'm
missing?

 

Related: should each class get its own $store?

 

- Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060112/dec51b11/attachment.htm


More information about the Dbix-class mailing list