PHPackages                             slince/sql-to-markdown - 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. [Database &amp; ORM](/categories/database)
4. /
5. slince/sql-to-markdown

ActiveLibrary[Database &amp; ORM](/categories/database)

slince/sql-to-markdown
======================

Convert mysql table schema to markdown table

0.0.1(6y ago)16975[1 issues](https://github.com/slince/sql-to-markdown/issues)MITPHP

Since Aug 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/slince/sql-to-markdown)[ Packagist](https://packagist.org/packages/slince/sql-to-markdown)[ RSS](/packages/slince-sql-to-markdown/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Sql To Markdown
===============

[](#sql-to-markdown)

Sql To Markdown 是一个可以将数据表的建表语句转换为 Markdown 表格的工具。

Installation
------------

[](#installation)

通过 Composer 安装

```
$ composer global require slince/sql-to-markdown
```

Usage
-----

[](#usage)

假设有一张表结构如下，将改sql保存到文件命名为 `foo.sql`

```
CREATE TABLE `hello_sql_to_markdown` (
  `id` int unsigned NOT NULL AUTO_INCREMENT default '0' COMMENT 'primary',
  `foo` decimal (20, 2) unsigned NOT NULL default '' COMMENT 'foo field',
  `bar` varchar (20) unsigned NOT NULL default '' COMMENT 'bar field',
  PRIMARY KEY (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=2367038934 DEFAULT CHARSET=utf8mb4 COMMENT='Demo table schema';
```

执行下面命令：

```
$ sql2markdown  convert  --source=foo.sql
```

即可在当前文件夹下生成 `foo.sql.md` 文件。

nametypelengthdefaultcommentidINT0primaryfooDECIMAL20,2foo fieldbarVARCHAR20bar field支持在一个文件里添加多个 DDL

查看帮助
----

[](#查看帮助)

```
$ sql2markdown --help
```

License
-------

[](#license)

The MIT license. See [MIT](https://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2542d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3785826?v=4)[Tao](/maintainers/slince)[@slince](https://github.com/slince)

---

Top Contributors

[![slince](https://avatars.githubusercontent.com/u/3785826?v=4)](https://github.com/slince "slince (6 commits)")

---

Tags

database-markdownsql-to-markdown

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slince-sql-to-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/slince-sql-to-markdown/health.svg)](https://phpackages.com/packages/slince-sql-to-markdown)
```

###  Alternatives

[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

2414.4k](/packages/perplorm-perpl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
