Re: extending the mdb schema format

From: Date: Thu, 21 Apr 2005 21:51:45 +0000
Subject: Re: extending the mdb schema format
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37327@lists.php.net to get a copy of this message
Lukas Smith wrote:
Hi, I know your are very busy Manuel and I want us to remain compatible. However I really need support for auto_increment in MDB2. I also wouldnt mind getting primary and foreign key support. Since I know that interest in the format has increased considerably since I have unbundled and fixed many bugs in MDB2_Schema I want to bring this up on this list to give other people the opportunity to pipe in with their thoughts. For reference see these documents: http://backendmedia.com/MDB2/docs/xml_schema_documentation.html http://backendmedia.com/MDB2/docs/MDB.dtd http://backendmedia.com/MDB2/docs/MDB.xsl http://cvs.php.net/co.php/pear/LiveUser/sql/auth_mdb_schema.xml 1) auto increment Currently you can only define sequences as follows: <sequence> <name>foo</name> <start>23</start> <on> <table>foo</table> <field>bar</field> </on> </sequence> The <start> and <on> tags are optional. The <on> tag basically lets you sync the sequence against a certain field in a table. Now I was pondering extending the <on> tag to also allow for an optional "<autoincrement>1</autoincrement>". This format is in the sprit of the rest of the tags in that it doesnt use atributes. Now the problem is that we may need a separate syntax for "I only want autoincrement!" and "Use autoincrement if available." as MDB2 supports a nice mode where either auto increment or sequences are used. I dont really like something like "<autoincrement>force</autoincrement>" for this case. I could also add something like this <autoincrement> <table>foo</table> <field>bar</field> <start>23</start> <force>1</force> </autoincrement> This is also not very nice and seriously screws with how the current code works and the current DTD is structured.
I have no comment on the other stuff, but I would suggest using <tryautoincrement/> for "use autoincrement if available" and <forceautoincrement/> for "use it no matter what" empty tags are your friend. Greg

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