数据库架构API
我正在寻找一个提供API(最好是.Net)的工具来查询多个数据库平台的架构。我正在构建一个软件,它将获取从此类工具返回的对象模型,然后分析架构并提供自定义查询生成器 - 如果可以避免这种情况,我宁愿不必编写架构分析工具。
理想情况下,它应该能够查询所有主要数据库平台,包括 MSSQL、Oracle、DB2、MySQL,甚至可能是 Sybase。 Red Gate Schema Compare SDK 正是我所需要的,但仅适用于 MSSQL。
有人遇到过这样的工具/库吗?
I'm looking for a tool that provides an API (preferably .Net) for querying the schema of multiple database platforms. I'm building a piece of software that would take the object model returned from such a tool and then analyse the schema and provide a custom query builder - I'd prefer to not have to write the schema analysis tool if I can avoid this.
Ideally it should be able to query all the major database platforms including MSSQL, Oracle, DB2, MySQL and possibly even Sybase. The Red Gate Schema Compare SDK does exactly what I need, but only for MSSQL.
Has anyone come across such a tool/library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是 100% 确定,但是 Mono 项目不会包含您正在寻找的代码吗?如果不是所有数据库,至少对其中一些数据库来说是这样。
I am not 100% sure, but wouldn't the Mono project contain the code you are looking for? If not for all databases, than I would expect at least for some of them.
简短的回答,不。
长的回答。
不久前我自己也在寻找这个,但没有找到免费的 .Net API。我发现的都是要花钱的。我提出了两个选项。
第一个选项不是我推荐的解决方案,但如果您确实不想自己编写“获取数据库元数据逻辑”,那么这是一个选项。
可视化查询生成器 http://www.query-objects.com/ 是一个 .Net 查询生成器一个图形用户界面。
您可以购买它的源代码许可证。拥有源代码后,您可以删除 UI 并在该源代码之上构建您自己的 API。它应该适用于 MSSql、Oracle、MySql,我想任何支持 ODBC 的数据库都可以。
第二个免费解决方案是尝试使用本教程自己编写它,例如:
http://www.dotnetbips.com/articles/bcd9065e-94af-4063-8360-f916571f9872.aspx
这里使用的 ADO.Net GetSchema 方法应该为您提供一种稍微一致的方法来获取来自您提到的不同数据库的元数据。
Short answer, No.
Long answer.
I was looking to this myself a while ago but didn't find a free .Net API. All the ones I found cost money. I came up with two options
The first one is not a solution I recommend, but an option if you really don't want to write the "get DB metadata logic" yourself.
Visual query builder http://www.query-objects.com/ is a .Net query builder with a GUI.
You could buy the source code license for it. Owning the source your can remove the UI and build your own API on top of that source code. It should work for MSSql, Oracle, MySql, and I guess any DB that supports ODBC.
The second and free solution is to try and write it yourself using this tutorial for example:
http://www.dotnetbips.com/articles/bcd9065e-94af-4063-8360-f916571f9872.aspx
The ADO.Net GetSchema method used here should give you a somewhat consistent way to get the Metadata from the different databases you mention.