标准数据库中立XSD描述关系数据库模式

时间:2023-01-31 16:57:26

Is anyone aware of a vendor neutral XSD to describe a relational database schema? Our system needs to grab information about the structure of a database:

是否有人知道供应商中立的XSD来描述关系数据库模式?我们的系统需要获取有关数据库结构的信息:

  • Tables
  • Columns and types
  • 列和类型

  • Primary and Foreign Keys Constraints
  • 主键和外键约束

  • Indexes
  • etc

in a vendor independent manner and store it in an XML file for later processing.

以独立于供应商的方式将其存储在XML文件中以供以后处理。

Before we do what we typically do and roll our own. I wanted to do some research and see if there was an existing XSD that people are standardizing on for what I assume is not an uncommon requirement for modeling tools and such. I did not find anything on Google that was not database vendor specific. If you know of an existing public standard I would very much appreciate a link.

在我们做我们通常做的事情之前,我们自己做。我想做一些研究,看看是否存在人们正在标准化的现有XSD,我认为这对于建模工具等并不是一种罕见的要求。我没有在Google上找到任何与数据库供应商无关的信息。如果您了解现有的公共标准,我将非常感谢链接。

Thanks in advance,

提前致谢,

Terence

3 个解决方案

#1


This isn't exactly what you're looking for, but the PostgresSQL Wiki has an interesting section on XML exports, that describes how they are supporting SQL and XML together. It displays a section on how a table would be exported as as XML and the XSD that would support it, which looks rather generic. It could serve as a model for you to create your own.

这不是您正在寻找的,但PostgresSQL Wiki有一个关于XML导出的有趣部分,它描述了它们如何一起支持SQL和XML。它显示了一个关于如何将表导出为XML的部分以及支持它的XSD,它看起来相当通用。它可以作为您创建自己的模型。

The Wiki talks about reference to a ISO/IEC 9075-14:2006 standard, that appears to be adopted by a few big vendors as a baseline. I quick browse on the ISO site says that :2006 was updated to 2008. I'm sure you can find a covered spec of this that you don't have to pay for to download.

Wiki讨论了ISO / IEC 9075-14:2006标准的提法,该标准似乎被少数大型供应商采用作为基准。我在ISO网站上快速浏览说:2006年更新到2008年。我相信你可以找到一个涵盖的规范,你不需要付费下载。

The article also points to a SQL/XML standard definition that is a bit outdated, but could serve your needs if you're looking for some basics.

本文还指出SQL / XML标准定义有点过时,但如果您正在寻找一些基础知识,它可以满足您的需求。

#2


Interesting problem - I am not aware of any standard or tool to achieve this.

有趣的问题 - 我不知道有任何标准或工具来实现这一目标。

You would almost have to have some kind of a "neutralized" version with adapters for each individual database system you want to target - even just to map all the various data types (VARCHAR and NVARCHAR in SQL Server, VARCHAR2 in Oracle and so on).

您几乎必须拥有某种“中和”版本,其中包含适用于您要定位的每个数据库系统的适配器 - 甚至只是映射所有各种数据类型(SQL Server中的VARCHAR和NVARCHAR,Oracle中的VARCHAR2等) 。

You might just use the types defined in the SQL:2003 standard - but even then you'd probably still have to have some kind of a vendor-specific mapping / adaption of sorts. Not to mention some kind of support for vendor-specific implementation details (like IDENTITY columns in SQL Server vs. SEQUENCE in Oracle and others).

您可能只使用SQL:2003标准中定义的类型 - 但即便如此,您可能仍需要某种特定于供应商的映射/适应性类型。更不用说对特定于供应商的实现细节的某种支持(例如SQL Server中的IDENTITY列与Oracle中的SEQUENCE等)。

Very interesting question! I hope others will be able to shed more light on the issue and maybe recommend an existing tool.

非常有趣的问题!我希望其他人能够更多地了解这个问题,并推荐一个现有的工具。

If not, and you decide to roll your own - consider making it open-source on CodePlex or Google Code! I'm sure a lot of folks would be most interested!

如果没有,并且您决定自己推出 - 请考虑在CodePlex或Google Code上开源!我相信很多人会最感兴趣!

MArc

#3


The UML Information Management Metamodel (IMM) Specification from OMG may worth a try.

OMG的UML信息管理元模型(IMM)规范值得一试。

#1


This isn't exactly what you're looking for, but the PostgresSQL Wiki has an interesting section on XML exports, that describes how they are supporting SQL and XML together. It displays a section on how a table would be exported as as XML and the XSD that would support it, which looks rather generic. It could serve as a model for you to create your own.

这不是您正在寻找的,但PostgresSQL Wiki有一个关于XML导出的有趣部分,它描述了它们如何一起支持SQL和XML。它显示了一个关于如何将表导出为XML的部分以及支持它的XSD,它看起来相当通用。它可以作为您创建自己的模型。

The Wiki talks about reference to a ISO/IEC 9075-14:2006 standard, that appears to be adopted by a few big vendors as a baseline. I quick browse on the ISO site says that :2006 was updated to 2008. I'm sure you can find a covered spec of this that you don't have to pay for to download.

Wiki讨论了ISO / IEC 9075-14:2006标准的提法,该标准似乎被少数大型供应商采用作为基准。我在ISO网站上快速浏览说:2006年更新到2008年。我相信你可以找到一个涵盖的规范,你不需要付费下载。

The article also points to a SQL/XML standard definition that is a bit outdated, but could serve your needs if you're looking for some basics.

本文还指出SQL / XML标准定义有点过时,但如果您正在寻找一些基础知识,它可以满足您的需求。

#2


Interesting problem - I am not aware of any standard or tool to achieve this.

有趣的问题 - 我不知道有任何标准或工具来实现这一目标。

You would almost have to have some kind of a "neutralized" version with adapters for each individual database system you want to target - even just to map all the various data types (VARCHAR and NVARCHAR in SQL Server, VARCHAR2 in Oracle and so on).

您几乎必须拥有某种“中和”版本,其中包含适用于您要定位的每个数据库系统的适配器 - 甚至只是映射所有各种数据类型(SQL Server中的VARCHAR和NVARCHAR,Oracle中的VARCHAR2等) 。

You might just use the types defined in the SQL:2003 standard - but even then you'd probably still have to have some kind of a vendor-specific mapping / adaption of sorts. Not to mention some kind of support for vendor-specific implementation details (like IDENTITY columns in SQL Server vs. SEQUENCE in Oracle and others).

您可能只使用SQL:2003标准中定义的类型 - 但即便如此,您可能仍需要某种特定于供应商的映射/适应性类型。更不用说对特定于供应商的实现细节的某种支持(例如SQL Server中的IDENTITY列与Oracle中的SEQUENCE等)。

Very interesting question! I hope others will be able to shed more light on the issue and maybe recommend an existing tool.

非常有趣的问题!我希望其他人能够更多地了解这个问题,并推荐一个现有的工具。

If not, and you decide to roll your own - consider making it open-source on CodePlex or Google Code! I'm sure a lot of folks would be most interested!

如果没有,并且您决定自己推出 - 请考虑在CodePlex或Google Code上开源!我相信很多人会最感兴趣!

MArc

#3


The UML Information Management Metamodel (IMM) Specification from OMG may worth a try.

OMG的UML信息管理元模型(IMM)规范值得一试。