[Catalyst] Stand-alone Scripts

Will Crawford billcrawford1970 at gmail.com
Fri Apr 27 14:17:26 GMT 2012


On 27 April 2012 14:54, Glen Diener <gdiener at excelii.com> wrote:
> Thanks for the suggestion. The error changed to:
>
> DBIx::Class::ResultSet::find(): DBI Connection failed: Can't connect to data source 'ARRAY(0xe8bfa0)' because I can't work out what driver to use (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1176

Then you also need this in your schema base class:

    use Catalyst::Model::DBIC::Schema::Types qw/ConnectInfo/;

    sub connection {
        my $self = shift;
        my $info = to_ConnectInfo( scalar (@_) > 1 ? [ @_ ] : $_[0] );
        return $self->next::method ($info);
    }

or you need to take the [ ... ] out from around your connect info args :)



More information about the Catalyst mailing list