Coder Social home page Coder Social logo

mysql_markdown's Introduction

It can generate markdown structure documents of MySQL succinctly~

build status


usage

gopath

wget https://golang.org/dl/go1.15.6.linux-amd64.tar.gz
tar -zxvf go1.15.6.linux-amd64.tar.gz
echo "export GOROOT=/opt/apps/go" >> /etc/profile
echo "export GOPATH=/opt/apps/go_path" >> /etc/profile
echo "export PATH=/opt/apps/go/bin" >> /etc/profile
echo "export PATH=/opt/apps/go_path/bin" >> /etc/profile
echo "export GOPROXY=https://goproxy.io" >> /etc/profile
source /etc/profile
go version

#go   
export GOROOT=/Users/fred/apps/go;  
export GOPATH=/Users/fred/apps/go_path;  
export PATH=$PATH:$GOROOT/bin;
export PATH=$PATH:$GOPATH/bin;
export GOPROXY=https://goproxy.io
# build install
git clone https://github.com/fanfq/mysql_markdown.git
cd mysql_markdown
go get "github.com/go-sql-driver/mysql"
go build -o /etc/go/bin/mysql_markdown mysql_markdown.go
chmod +x /etc/go/bin/mysql_markdown

mysql_markdown -d dbname -o /Users/fred/Desktop/123/d.md
mysql_markdown -h 127.0.0.1 \
-u root \
-p root \
-d dbname \
-o /Users/fred/Desktop/123/d.md

背景

在实施软件工程的时候,当要将某一版本归档时,需要汇总的文档要求还是比较高的、各类文档齐全,包括项目架构、项目安装、接口等文档,而数据库表结构说明文档亦属于其一。记得很早之前想找一个可以导出 MySQL 数据库表结构说明文档的工具,生态上的这种工具是有的、只不过并没有一个使我比较满足的。当然、看个人所需,我需要一个可以导出 markdown 文档的。

于是 mysql_markdown 就出现了、应用而生。它是一款基于 go 语言编写的一个命令行工具,适用于 LinuxMacWindows等平台。那么它可以做什么?他只有一个功能、就是生成数据库表结构说明文档,格式为markdown

安装

releases download

使用

# 帮助函数
➜  mysql_markdown -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

# 简单使用
➜ mysql_markdown -p samego -d samego
mysql connected ...
1/8 the demo table is making ...
2/8 the failed_jobs table is making ...
3/8 the migrations table is making ...
4/8 the password_resets table is making ...
5/8 the roles table is making ...
6/8 the user table is making ...
7/8 the userinfo table is making ...
8/8 the users table is making ...
mysql_markdown finished ...

md2anyDoc

md转其它类型的文档推荐使用 typora 工具 它支持如下转换格式

  • md2pdf
  • md2html
  • md2html(without styles)
  • md2word
  • md2rtf
  • md2openOffice
  • md2Epub
  • md2latex
  • md2MediaWiki
  • md2reStructureText
  • md2textile
  • md2OPML
  • md2png

文档页面效果

生成的MD文件

MySQL 表结构生成 Markdown 文档

MD文件转PDF

MySQL 表结构生成 Markdown转PDF 文档

mysql_markdown's People

Contributors

alicfeng avatar fanfq avatar linkstarter avatar lljiuzheyang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.