Did you install DBI, DBD::mysql and DBD::Pg? (and mysql-client and analog of mysql-client for pg)

30.11.2011 4:38, Puneet Kishor пишет:
I must be doing something wrong, but don't know what. I have the following 
database definitions in my config file

     plugins:
         Database:
             connections:
                 pg:
                     driver: 'Pg'
                     ..
                     ..
                 mysql:
                     driver: 'mysql'
                     ..
                     ..

Then, in my code

     my $sth1 = database->('pg')->prepare(qq{
         SELECT blah
     });
     $sth1->execute();

     and

     my $sth2 = database->('mysql')->prepare(qq{
         SELECT blah
     });
     $sth2->execute();

But, I get the following error in my log file

     Can't connect to data source 'dbi:' 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 
/opt/local/lib/perl5/site_perl/5.14.1/Dancer/Plugin/Database.pm line 161 in 
/opt/local/lib/perl5/site_perl/5.14.1/Dancer/Handler.pm l. 90

I am using Dancer::Plugin::Database 1.51

--
Puneet Kishor
_______________________________________________
Dancer-users mailing list
[email protected]
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users

--
Best Regards,
Nick Knutov
http://knutov.com
ICQ: 272873706
Voice: +7-904-84-23-130
_______________________________________________
Dancer-users mailing list
[email protected]
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users

Reply via email to