[Dbix-class] Configuration query - Catalyst::Model::DBIC::Schema

Peter Flanigan pjf at roxsoft.co.uk
Mon Jul 28 14:02:04 BST 2008


Dermot wrote:
> I don't want to hard-code the path to the SQLite file but unless I do
> I am getting DBI Connection failed: unable to open database file(1)
> after a login attempt.

package YourApp::Model::YourModel;

use base qw(Catalyst::Model::DBIC::Schema);

__PACKAGE__->config( connect_info => [], schema_class => undef );

sub new {
    my ($me, $app, @rest) = @_;

    $me->config( connect_info => $app->config->{connect_info} );
    $me->config( schema_class => $app->config->{schema_class} );

    my $self  = $me->NEXT::new( $app, @rest );

    return $self;
}


Cut down from one of my models so untested

-- 

Regards



More information about the DBIx-Class mailing list