Question

In SQL:2008, and also previous standards, the INFORMATION_SCHEMA is described as the standard meta-schema. In principle, meta-data could be unloaded into XML for further processing and reverse-engineering of schema meta data with XSLT and other XML tools.

  • Has this been done before?
  • Is there a somewhat complete XSD available, that describes the INFORMATION_SCHEMA?

N.B: I'm asking this because I would like to implement unloading of a database schema into a SQL standard INFORMATION_SCHEMA XML structure in jooq-meta, and then in a second process to load that schema again, to generate Java source code artefacts in jOOQ. For that, I would prefer not to roll my own XSD, but use a pre-existing as-close-to-the-standard-as-possible XSD

Était-ce utile?

La solution

ANSI/ISO have not defined a particular way of representing a database schema using XML.

The latest standard is SQL:2011.

Here you can see the list of official standards. But, as you can see, they're not free:

35.060: Languages used in information technology

Look for ISO/IEC 9075-x in the list. As you can see there's still only the old INFORMATION SCHEMA.

So, your only option is to look for something widely used. Altova has its own way of doing this (a function named "Create XML Schema from DB Structure"). Look at this link: How to Convert a Database to an XML Schema

This application has also options to create the database from the exported schema.

I think this is the closest to an standard that you can find (Altova is one of the leading XML software companies. If there was some kind of standard they should know it and use it).

Oxygen XML has also its own way of doing this, and it lloks like there is some kind of "IOS draft":

Extract XML Schema From a Database Structure

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top