[Dbix-class] RecursiveUpdate and many to many
Matt S Trout
dbix-class at trout.me.uk
Tue Sep 30 13:25:28 BST 2008
On Mon, Sep 29, 2008 at 05:39:25PM +0100, Pedro Melo wrote:
> Hi,
>
> On Sep 29, 2008, at 4:50 PM, Matt S Trout wrote:
>
> >On Sun, Sep 28, 2008 at 05:56:11PM +0100, Oliver Gorwits wrote:
> >>Ideally, DBIC would instead populate the relationship_info details
> >>after someone has set up __PACKAGE__->many_to_many(...). That would
> >>avoid this guesswork.
> >
> >That would make no sense at all since many-to-many is NOT A
> >RELATIONSHIP.
>
> I've been in this list for some years now that I've seen this phrase
> written several times.
>
> <pedantic>
> If I recall correctly my time at CS department where I was forced to
> read the relational model (not the -for-dummies version that is SQL
> today. but the true horrid version), many-to-many was in fact a
> relationship.
In DBIx::Class terms, that's not how we model it.
> Having said that, it is trivial to use your own base class for your
> sources in a way that you can catch many-to-many declarations and
> cache the result somewhere private (your own version of
> relationship_info()).
Please if you do that call it something -other- than relationship_info.
> I say that this is possible because I have code running in production
> that does exactly that: creates a parallel relationship_info()
Much DBIC code and extension stuff assumes that anything in there is
a relationship in the DBIC sense.
if you start putting many-to-many stuff in there, your code is broken. It
just might not have caused you any bugs yet.
--
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 DBIx-Class
mailing list