[CDBI] State of the DBIx::Class Class::DBI compatibility layer

Matt S Trout dbix-class at trout.me.uk
Thu Feb 14 14:00:45 GMT 2008


On Thu, Feb 14, 2008 at 02:06:50AM -0800, Michael G Schwern wrote:
> Currently, in CDBICompat, if you declare a relationship to another class the 
> foreign class either has to A) already be declared or B) has to be in a file 
> that can be required.
> 
> If you have each class in its own file you're good.  Other CDBI projects might 
> have to restructure how they declare their classes so the relationships are 
> declared last.
> 
> I took another look at it and this limitation will be difficult to lift 
> without changing how DBIC relationships work.

I was considering making this work for DBIC by being able to say "delay
relationship setup until I tell you I've got everything loaded".

But then, obviously, you have to tell it. Which is ok in DBIC, because I
can just have load_classes handle that, but I'm not sure if I can get an
equivalent "magic hook" for CDBICompat - I suppose you could use a source
filter to whack a DBIC->undelay call at the end of the file but, erm, ick.

If somebody finds a hook we can use and writes me some tests I've got no
problem with dealing with the DBIx::Class internals part.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the ClassDBI mailing list