在 SQL:2008
以及以前的标准中,< code>INFORMATION_SCHEMA 被描述为标准元模式。原则上,元数据可以卸载到 XML 中,以便使用 XSLT 和其他 XML 工具对模式元数据进行进一步处理和逆向工程。
- 这以前做过吗?
- 是否有一个比较完整的 XSD 可用来描述
INFORMATION_SCHEMA
?
注意:我问这个问题是因为我想将数据库模式卸载到 INFORMATION_SCHEMA XML 结构中"nofollow" title="Java 面向对象查询 (jOOQ) 是一种类型安全的 SQL 查询构建器,直接在 Java 流利 API 中对标准和特定于供应商的 SQL 构造进行建模。">jooq-meta,然后在第二个进程再次加载该模式,以在 jOOQ 中生成 Java 源代码工件。为此,我不想推出自己的 XSD,而是使用预先存在的尽可能接近标准的 XSD
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
发布评论
评论(1)
ANSI/ISO 尚未定义使用 XML 表示数据库模式的特定方式。
最新标准是SQL:2011。
在这里您可以看到官方标准列表。但是,正如您所看到的,它们不是免费的:
35.060:信息技术中使用的语言
在列表中查找 ISO/IEC 9075-x。正如您所看到的,仍然只有旧的信息架构。
因此,您唯一的选择就是寻找广泛使用的东西。 Altova 有自己的方法来执行此操作(名为“从 DB 结构创建 XML 架构”的函数)。看这个链接:
如何将数据库转换为 XML 架构
此应用程序还提供以下选项:从导出的架构创建数据库。
我认为这是您能找到的最接近标准的(Altova 是领先的 XML 软件公司之一。如果有某种标准,他们应该知道并使用它)。
Oxygen XML 也有自己的方法来做到这一点,它就像有某种“IOS 草案”:
从数据库结构中提取 XML 架构
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