https://github.com/wilsonehusin/sqldoc
Generate markdown documentation from SQL tables.
https://github.com/wilsonehusin/sqldoc
database documentation documentation-generator postgres postgresql sql
Last synced: 10 months ago
JSON representation
Generate markdown documentation from SQL tables.
- Host: GitHub
- URL: https://github.com/wilsonehusin/sqldoc
- Owner: wilsonehusin
- License: mit
- Created: 2024-04-28T17:51:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T22:04:32.000Z (over 1 year ago)
- Last Synced: 2025-03-28T17:57:16.401Z (about 1 year ago)
- Topics: database, documentation, documentation-generator, postgres, postgresql, sql
- Language: Go
- Homepage:
- Size: 325 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SQLDoc
SQLDoc is a markdown documentation for SQL tables. Inspired by Rails ActiveRecord `schema.rb` and [drwl/annotaterb](https://github.com/drwl/annotaterb).

## Installation
### Using Go
Recommended if you have Go toolchain already set up.
```sh
go install go.husin.dev/sqldoc@latest
```
### Prebuilt binaries
Download the latest release from [GitHub releases](https://github.com/wilsonehusin/sqldoc/releases).
## Features
- [x] Show columns
- [x] Show column types
- [x] Show column nullability and defaults
- [ ] Show column indexes
- [ ] Show column constraints
Supported database engines:
- [x] PostgreSQL
- [ ] MySQL
- [ ] SQLite
## Why?
Projects often manages their schema roll out through migrations (e.g. [golang-migrate/migrate](https://github.com/golang-migrate/migrate)). As a project matures, it's quite common to encounter several `ALTER TABLE` commands, which makes it difficult to have a near-instant idea of what the schema looks like.
In Rails, `schema.rb` provides that insight, while extensions like [drwl/annotaterb](https://github.com/drwl/annotaterb) goes further to co-locate the schema documentation with the model definitions.
SQLDoc makes it easy to look at Markdown documentation for SQL tables, which I prefer over running `psql -c "\d+ table_name"`.