Giter Club home page Giter Club logo

dbdoc's Introduction

Database to Document

中文介绍

Download

download at release page

How to use

dbdoc -c config.json

config file

{
  "db_info": {
    "db_type": "mysql",  // required
    "ip_port": "127.0.0.1:3306", // required
    "username": "root", // required
    "password": "", // required
    "schema": "cms" // required
  },
  "includes": [  // optional
  ],
  "excludes": [  // optional
  ],
  "template_path": "", // optional
  "out_path": ""  // optional
}
Property Description Required
db_type database driver name Required
ip_port database's host and port Required
username username Required
password password Required
schema the schema you want to read Required
includes the tables you want to generate. Default: all tables Optional
excludes the tables you dont't want to generate. Optional
template_path the path of document layout file Optional
out_path the path you want to save. Default: schema_doc.md Optional

Supported database

Database db_type
MySQL mysql
SQL Server mssql

Template

You can use your own template such as html, json by set the template_path. The tool also offers a default markdown template for you.

{{- .schema}} Document
{{range .tables -}}
# {{.TableName}}
|column|type|description|
| ------| ------ | ------ |
{{- range .Columns}}
|{{.ColumnName}}|{{.ColumnType}}|{{.Description -}}|
{{- end}}

{{end}}

The template uses the golang text/template, you can read the grammar at here

TODO

  • Support more database.
  • Support Microsoft Office Word/Excel.
  • Humanized command line arguments like MySQL.

dbdoc's People

Contributors

chenyahui 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.