PHPackages                             peng49/db2markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. peng49/db2markdown

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

peng49/db2markdown
==================

php auto generate markdown for database

0.3.0(2y ago)421MITPHPPHP &gt;=5.1.0

Since Apr 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/peng49/db2markdown)[ Packagist](https://packagist.org/packages/peng49/db2markdown)[ Docs](https://github.com/peng49/db2markdown)[ RSS](/packages/peng49-db2markdown/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

#### 通过Sql语句生成markdown文档的php程序

[](#通过sql语句生成markdown文档的php程序)

##### 安装

[](#安装)

> composer require peng49/db2markdown

##### 命令行使用

[](#命令行使用)

> php vendor/bin/db2markdown

输入数据库的 地址(host), 端口(port) 用户名,密码,要导出的表,默认是\*,生成所有表的文档,指定多个表明用逗号隔开,如: table1,table2

```
$ php src/bin/db2markdown
please enter the db(1 mysql,2 postgresql):
please enter the host(localhost):
please enter the port(3306): 3310
please enter username(root):
please enter password: password
please enter database: acg
please enter tables(default is *,match all table):

admin_menu successful

admin_operation_log successful

admin_permissions successful

....

E:\develop\db2markdown\db2markdown20230712091813.md is export success
```

导出PostgreSQL结构

```
$ php src/bin/db2markdown
please enter the db(1 mysql,2 postgresql): 3
please enter the db(1 mysql,2 postgresql): 2
please enter the host(localhost):
please enter the port(5432): 5432
please enter username(root): odoo
please enter password: password
please enter database: gocron
please enter table schema(public):
please enter tables(default is *,match all table):

task successful

task_log successful

host successful

......

E:\develop\db2markdown\db2markdown20230712092030.md is export success
```

##### 代码中使用

[](#代码中使用)

```
