Re: Foreign Keys in XML

From: Date: Wed, 25 Oct 2006 19:01:24 +0000
Subject: Re: Foreign Keys in XML
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44750@lists.php.net to get a copy of this message
David Morse wrote:
Suppose I have a foreign key column AddressID in a Person table that references the primary key AddressI of the Address table. I define both a foreign key constraint for AddressID in the Person table and, often, a normal index. If I am trying to use conventions that don't proliferate or obfuscate names unnecessarily, I would like to call the index "AddressID" and the foreign reference "AddressID". But since they are both "index" elements in the proposed syntax, I have a name clash when I parse the XML and try to identify "indices" by name. This could be kluged by choosing a different naming convention, such as appending "idx" to the names of indices, or "ref" to the names of foreign key references. It could also be kluged by allowing for multiple indices with the same name, and then examining there contents to determine which ones are actually being used to represent foreign key constraints. The problem arose, however, only because I treated a foreign key as a kind of index in the XML DTD, rather than introducing a separate type of "foreign" subelement for a table. Indices and foreign keys are conceptually distinct, and the XML DTD should reflect this.
Ok, understood. The problem is that some RDBMS have separate namespaces, but some dont. So since portability is the aim, relying on separate namespaces is not a good idea anyways.
The status is that I am hoping someone will implement it :) However I have given lead of the MDB2_Schema package to Igor.
Should I bug Igor, and leave you out of it, or bug Igor and cc you.
Bug Igor, but even better talk to pear-dev, both of us read that list. regards, Lukas

« previous php.pear.dev (#44750) next »