[Catalyst] Can't infer join condition

Brandon Black blblack at gmail.com
Mon Jan 16 15:56:09 CET 2006


On 1/16/06, Chisel Wright <chisel at herlpacker.co.uk> wrote:
> On Mon, Jan 16, 2006 at 12:23:36PM +0000, Chisel Wright wrote:
> > Does anyone know what might cause the following error?
> >
> > ---- cut here ----
> > chisel at zombie parley $ ./script/parley_server.pl -r
> > Too late to run INIT block at /usr/lib/perl5/vendor_perl/5.8.7/Class/C3.pm line 52.
> > Couldn't load "Parley::Model::ParleyDB::Person", "Can't infer join condition for authentication on Parley::Model::ParleyDB::Person; Parley::Model::ParleyDB::Authentication has no primary keys at /usr/lib/perl5/vendor_perl/5.8.7/Module/Pluggable/Fast.pm line 82
> > Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.7/Module/Pluggable/Fast.pm line 82.
> > " at /usr/lib/perl5/vendor_perl/5.8.7/Module/Pluggable/Fast.pm line 84.
> > Compilation failed in require at ./script/parley_server.pl line 49.
> > chisel at zombie parley $
> > ---- cut here ----
>
> Responding to myself in case anyone else hits this.
>
> It dawned on me that it wasn't finding columns in my tables, so I
> thought I'd check the Pg loader using my bash function:
>
>  chisel at zombie parley $ perlversion  DBIx::Class::Loader::Pg
>  Can't locate Lingua/EN/Inflect.pm in @INC
>
> So, I installed Lingua::EN::Inflect and DBIx::Class::Loader::Pg was much
> happier when it was used.
>
> What dark magic prevented the actual "oh s**t, can't load
> DBIx::Class::Loader::Pg" error message from being displayed?
>

I suspect that your relationship is still not being defined correctly.
 I thought we had made DBIx::Class::Loader handle the "no primary
keys" case correctly, but now that I looked again, it looks kinda
broken.  The final call to _has_many() doesn't specify the column
explicitly, and DBIx::Class won't find it if it isn't a PK (unless by
happy magic accident it is the same as the lowercase of the last part
of the table class name).

-- Brandon



More information about the Catalyst mailing list