用途
将数据库的表结构导出未markdown表格,这样我只用维护数据库的备注,然后每次更新文档的时候从数据库里导出表格:
项目地址
使用方法
root@ceph03:/home/bill# ./mysql_markdown_unix -h
flag needs an argument: -h
Usage: mysql_markdown [options...]
--help This help text
-h host. default 127.0.0.1
-u username. default root
-p password. default root
-d database. default mysql
-P port. default 3306
-c charset. default utf8
-o output. default current location
-t tables. default all table and support ',' separator for filter, every item can use regexp
// 导出tidb数据库里的tpcc数据库表结构
// tidb:192.168.1.93:4000 数据库名:tpcc 用户:root 密码:空
// 导出结果:tpcc_20210414_172002.md
root@ceph03:/home/bill# ./mysql_markdown_unix -h 192.168.1.93 -u root -p "" -P 4000 -d tpcc
1/9 the warehouse table is making ...
2/9 the customer table is making ...
3/9 the history table is making ...
4/9 the new_order table is making ...
5/9 the orders table is making ...
6/9 the order_line table is making ...
7/9 the stock table is making ...
8/9 the item table is making ...
9/9 the district table is making ...
mysql_markdown finished ...
root@ceph03:/home/bill# ll
total 4.4M
drwxr-xr-x 2 root root 4.0K Apr 14 17:20 ./
drwxr-xr-x 6 root root 4.0K Apr 13 10:27 ../
-rwxr-xr-x 1 root root 4.3M Apr 14 17:12 mysql_markdown_unix*
-rw-r--r-- 1 root root 1.2K Apr 13 10:24 topo.yaml
-rwxr-xr-x 1 root root 5.8K Apr 14 17:20 tpcc_20210414_172002.md*