[Catalyst] Re: Adding relationships to loaded CDBI models
samwyse at gmail.com
Mon Jun 20 18:10:42 CEST 2005
On 6/19/05, Sebastian Riedel <sri at oook.de> wrote:
> Am 20.06.2005 um 00:55 schrieb James Tolley:
> > Also, unless I missed
> > something, it doesn't handle might_have or many-to-many mapping
> > relationships. Are there plans to handle these issues?
> How do you explicitly define a might_have relationship in sql? :)
I haven't gotten anything into code yet, but for a long time I've
thought about using "SELECT COUNT(*) FROM table" to infer similar
facts. If you have 1,000 Person records and only 500 Spouse records,
then obviously "Person might have Spouse". OTOH, if you have 1,000
Person records and 1,500 Offspring records, then it is less obvious
that "Person might have Offspring".
Off-subject but very much on-topic, everyone always needs more
meta-data about tables and columns than SQL can provide. Obviously, I
can generate additional tables of meta-information for my databases,
but then there's the difficulty of keeping those tables in sync with
ALTER TABLE commands and the like. Every database that I can think of
has some sort of SYS_TABLES view of the "native" meta-data; I've often
wondered if it would be possible to support ALTER TABLE for those
views so I can keep my meta-information along side the system's.
More information about the Catalyst