PHP 生成数据库的 markdown 字段说明文档,支持 mysql,postgresql - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
请不要在回答技术问题时复制粘贴 AI 生成的内容
peng49

PHP 生成数据库的 markdown 字段说明文档,支持 mysql,postgresql

  •  
  •   peng49
    peng49 Jul 13, 2023 1302 views
    This topic created in 1019 days ago, the information mentioned may be changed or developed.

    安装

    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 

    代码中使用

    <?php require_once "vendor/autoload.php"; /* @var $generator \DB2Markdown\Generator\Mysql */ $generator = \DB2Markdown\Factory::getGenerator('mysql'); //mysql $generator->setHost('localhost') ->setPort(3306) ->setDatabase('database') ->setUsername('username') ->setPassword('password') ->output("filename", "*"); 

    源码

    Github: https://github.com/peng49/db2markdown

    Packagist: https://packagist.org/packages/peng49/db2markdown

    2 replies    2023-07-13 13:29:25 +08:00
    mrpzx001
        1
    mrpzx001  
       Jul 13, 2023
    815979670
        2
    815979670  
       Jul 13, 2023
    https://www.dbkuaizi.com/archives/97.html
    很久之前写过一个单文件版本的,但只支持 mysql 或 mariadb
    About     Help     Advertise     Blog     API     FAQ     Solana     2542 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 34ms UTC 16:06 PVG 00:06 LAX 09:06 JFK 12:06
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86