[Dbix-class] quickest way to determine the relationship type

Matt S Trout dbix-class at trout.me.uk
Tue May 22 17:19:30 GMT 2007


On Tue, May 22, 2007 at 08:41:30AM -0700, John Napiorkowski wrote:
> Hi,
> 
> I'm trying to figure out the easiest way to determine
> the type of relationship between two resultsets. 
> Basically I'd like to find out if it's a parent-child
> type relationship, where the child needs PK's from the
> parent or if it's a object-attribute type, where the
> primary object takes FK's from the attribute object.
> 
> I can see a couple of ways using ->relationship_info,
> but wanted to hear if there is a 'canonical' and
> simple way for this.

The SQLT parser/producer stuff has code to handle this - maybe worth factoring
it back into ResultSource?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list