Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with set_sql in Class::DBI::Loader::mysql

3 views
Skip to first unread message

Eden Cardim

unread,
Mar 22, 2006, 2:47:44 PM3/22/06
to
Hello everyone,
I'm developing a system based on Maypole, which in turn is based on
Class::DBI::Loader. SQLite was being used for testing, until then
everything was fine. But when I switched over to mysql, its
corresponding Loader class complains about not having the set_sql
method available in Class::DBI::mysql, which it should since it
inherits from Class::DBI. The doc synopsis for
Class::DBI::Loader::mysql doesn't even compile, the output is:

Couldn't require loader class "Class::DBI::Loader::mysql", "Can't
locate object method "set_sql" via package "Class::DBI::mysql" at
/usr/lib/perl5/site_perl/5.8.6/Class/DBI/mysql.pm line 58.
Compilation failed in require at
/usr/lib/perl5/site_perl/5.8.6/Class/DBI/Loader/mysql.pm line 8.
Compilation failed in require at (eval 1) line 2.
BEGIN failed--compilation aborted at (eval 1) line 2.
" at /usr/lib/perl5/site_perl/5.8.6/Class/DBI/Loader.pm line 81.

I've tried debugging the thing up to where it calls the set_sql method,
the @Class::DBI::mysql::ISA array is fine, but still the method won't
show up. I'm running a fedora 4 linux box, mysql 5.0 and perl 5.8.6. I
installed DBD::mysql from the fedora package repository. Who's doing it
wrong, me or the module?
Thanks in advance.

stephane...@gmail.com

unread,
Mar 25, 2006, 12:47:30 PM3/25/06
to
Eden Cardim a écrit :

> Couldn't require loader class "Class::DBI::Loader::mysql", "Can't
> locate object method "set_sql" via package "Class::DBI::mysql" at
> /usr/lib/perl5/site_perl/5.8.6/Class/DBI/mysql.pm line 58.
> Compilation failed in require at
> /usr/lib/perl5/site_perl/5.8.6/Class/DBI/Loader/mysql.pm line 8.
> Compilation failed in require at (eval 1) line 2.
> BEGIN failed--compilation aborted at (eval 1) line 2.
> " at /usr/lib/perl5/site_perl/5.8.6/Class/DBI/Loader.pm line 81.

Very same problem here, trying to build an application with Catalyst
... Any perl guru with a good hint ?

Stéphane

Eden Cardim

unread,
Mar 28, 2006, 7:41:23 AM3/28/06
to
stephane...@gmail.com wrote:
> Very same problem here, trying to build an application with Catalyst
> ... Any perl guru with a good hint ?

I figured it out. For some reason, the modules aren't loading in the
correct order, I didn't have time to delve deeper into the module code.
So I tried loading them manually and it ended up working. So, start
your code with this:

use Class::DBI::Loader;
use Class::DBI::mysql;
use Class::DBI::Loader::mysql;

and everything should go fine.

0 new messages