schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

In MySQL - not getting table comments, engine, charset, collation from crawler output #189

Closed mysqldesu closed 6 years ago

mysqldesu commented 6 years ago

When outputting all the meta data from a MySQL schema, I am not getting data related to table comments, columns comments, table engine, table charset, column charset and column comments. I want to perform diffs including those items. Is there a way to get that information also? Much of this data is available from "show create table tablename".

This is the command I'm running:

schemacrawler -host=XXX.XXX.XX.XXX -server=mysql -database=test -schemas=test -user=root -password='XXXXXX' -infolevel=maximum -command=schema -outputfile=test.txt

SchemaCrawler 14.21.02 OS: Centos 7 Database: MySQL 5.7 JDBC driver: mysql-connector-java-8.0.11.jar Java Version: java-1.8.0-openjdk-devel

I'm getting table name, columns, data types, indexes fine but would like to see the other information also.

sualeh commented 6 years ago

I have fixed the issue with table and column comments, and it will be available in the next release of SchemaCrawler. For the rest of the information, you can use a user-defined query. You can define the query in the SchemaCrawler config file, and use the query name as a command. Or, you can use the query itself as a command, like this:

-command="SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES"

mysqldesu commented 6 years ago

Thanks for working on this and the idea to use a command line query to get the other items! Really appreciate it.