database('pg')-> prepare...

29.11.2011 23:38 ΠΟΜΨΪΟΧΑΤΕΜΨ "Puneet Kishor" <punkish@eidesis.org> ΞΑΠΙΣΑΜ:
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
Dancer-users@perldancer.org
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users