Re: SQL->XML mapping

From: Date: Wed, 31 Dec 2003 15:33:06 +0000
Subject: Re: SQL->XML mapping
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24687@lists.php.net to get a copy of this message
I have some simple Java code on that one, can come up w/ the PHP version so you can then use it (cannot promise to maintain it due to time limitations). It does the SQL identifiers/values -> XML identifere/values mapping and the converse. I have not tackled the generation of XML Schemas from SQL Schemas. One thing that would make either (XML docs from resultsets, and XML Schemas from SQL Schemas) easier would be to have the Database absetraction layers (or related packages/classes) provide some meta-info (table, db, column type, etc.), and have a set of predefined SQL types that can be easily mapped to XML types, sort of what the JDBC ResultSetMetaData class provides in Java. Yeah, one of the primary reasons we created Creole (the JDBC-like DB abstraction used by Propel) was to provide a very complete (organized into classes) metadata system. It's more closely related to the Hibernate metadata classes than to JDBC metadata classes. Of course, I don't know how to do ResultSetMetaData in PHP (would be nice!), but we can do pretty good discovery of full table info using SQL queries. IMO the Creole metadata API is easier to use than JDBC anyway (at the cost of being slightly less all-encompassing).
Creole also uses a unified type system based on the JDBC types -- primarily in order to support the XML <-> SQL <-> DB MetaData mapping stuff needed by Propel. I've chatted breifly w/ Lukas about this stuff. MDB (at least MDB2) also has some defined types, and hopefully some of this metadata stuff can find its way into MDB2/3 or an extension to MDB. I'll also take a look at this standard, as it would be nice to use a standard for Propel, if appropriate. Of course the goal behind Propel isn't so much to provide the kitchen sink DB_Schema, and in fact I'd be very interested in using a "standard" soolution (DB_Schema, e.g.). Cheers, Hans

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