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 2d 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 49% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

2450d 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

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[guikingone/scheduler-bundle

A Symfony bundle that allows to schedule and create repetitive tasks

114217.4k](/packages/guikingone-scheduler-bundle)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)[psx/sql

Generate type-safe PHP classes from your database

1773.4k4](/packages/psx-sql)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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