[Catalyst] connection info and Catalyst::Model::DBIC::Schema

Alan Humphrey alan.humphrey at comcast.net
Thu Aug 3 21:51:08 CEST 2006

I feel that I'm missing something obvious, but the penny hasn't dropped.
Hope you all can help.

Goal: use a DBIx::Class schema defined outside the Catalyst app name space.

Using: Catalyst::Model::DBIC::Schema

Problem: I have to define the connection information in my Catalyst

package Engoi::Model::Schema;

use strict;
use base 'Catalyst::Model::DBIC::Schema';

    schema_class => 'Engoi::Schema::EngoiDbDev',
    connect_info => [

If I comment out the connection info I get the following error on app

Couldn't instantiate component "Engoi::Model::Schema", "Can't locate object
method "storage" via package "Engoi::Schema::EngoiDbDev"

Engoi::Schema::EngoiDbDev look like:

package Engoi::Schema::EngoiDbDev;

use strict;
use warnings;
use Engoi::Schema::EngoiDb;

my @conn_info = (
    { RaiseError => 1, PrintError => 0, ShowErrorStatement => 1, TraceLevel
=> 0 }

Engoi::Schema::EngoiDb->compose_connection( __PACKAGE__, @conn_info );


I'd like to be able to keep the connection info here, not in
Engoi::Model::Schema to make it easier to use the  schema in non-Catalyst

The C::M::D::S docs say this about connect_info

This is not required if schema_class already has connection information
defined inside itself (which isn't highly recommended, but can be done)

So, why isn't this recommended and how is it done?

Thank you!

- Alan

More information about the Catalyst mailing list