是否有用于为SQL Server生成完整数据库DDL的工具?那么Postgres和MySQL呢? [英] Is there a tool to generate a full database DDL for SQL Server? What about Postgres and MySQL?

查看:95
本文介绍了是否有用于为SQL Server生成完整数据库DDL的工具?那么Postgres和MySQL呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Toad for Oracle,我可以生成完整的DDL文件,以描述Oracle模式的所有表,视图,源代码(过程,函数,包),序列和授权.一个很棒的功能是它将每个DDL声明分成不同的文件(每个对象的文件,可以是表,过程,视图等),因此我无需数据库连接就可以编写代码并查看数据库的结构.使用DDL文件的另一个好处是,我不必在每次需要查看表定义时都连接到数据库以生成DDL.在Toad for Oracle中,执行此操作的方法是转到数据库"->导出",然后根据要导出的内容选择适当的菜单项.它可以为您提供此时的数据库概况.

Using Toad for Oracle, I can generate full DDL files describing all tables, views, source code (procedures, functions, packages), sequences, and grants of an Oracle schema. A great feature is that it separates each DDL declaration into different files (a file for each object, be it a table, a procedure, a view, etc.) so I can write code and see the structure of the database without a DB connection. The other benefit of working with DDL files is that I don't have to connect to the database to generate a DDL each time I need to review table definitions. In Toad for Oracle, the way to do this is to go to Database -> Export and select the appropriate menu item depending on what you want to export. It gives you a nice picture of the database at that point in time.

是否有一个批处理"工具可以导出
-所有表DDL(包括索引,检查/引用约束)
-所有源代码(每个过程,函数使用单独的文件)
-所有视图
-所有序列
从SQL Server?

Is there a "batch" tool that exports
- all table DDLs (including indexes, check/referential constraints)
- all source code (separate files for each procedure, function)
- all views
- all sequences
from SQL Server?

PostgreSQL呢?
那么MySQL呢?
那Ingres呢?

What about PostgreSQL?
What about MySQL?
What about Ingres?

对于该工具是开源还是商业,我没有任何偏好.

I have no preference as to whether the tool is Open Source or Commercial.

推荐答案

在PostgreSQL中,只需对pg_dump使用-s选项.您可以以自定义格式将其作为普通的sql脚本(整个数据库一个文件)来获取,然后可以将其放在该脚本上以根据需要为每个对象获取一个文件.

In PostgreSQL, simply use the -s option to pg_dump. You can get it as a plain sql script (one file for the whole database) on in a custom format that you can then throw a script at to get one file per object if you want it.

PgAdmin工具还将向您显示每个对象的SQL转储,但我认为没有一种很好的方法可以一次从那里获取所有对象.

The PgAdmin tool will also show you each object's SQL dump, but I don't think there's a nice way to get them all at once from there.

这篇关于是否有用于为SQL Server生成完整数据库DDL的工具?那么Postgres和MySQL呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆