Metadata-Version: 2.3
Name: pg-diagram
Version: 0.2.0
Summary: A tool for creating ER diagrams from postgresql database schemas
Requires-Dist: graphviz>=0.20.3
Requires-Dist: sqlglot>=26.24.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

## pg_diagram

[![PyPI version](https://badge.fury.io/py/pg-diagram.svg)](https://badge.fury.io/py/pg-diagram)

A tool for creating [Entity-relationship diagrams](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model) for PostgreSQL

### Installation

- install [Graphviz](https://graphviz.org)
-
    ```bash
    pip install pg-diagram
    ```
### Usage
```bash
pg_diagram --format svg -o diagram.svg schema.sql
```
```bash
# or feed output of pg_dump
pg_dump --schema-only mydb | pg_diagram -o mydb.png -
```

### Sample output
<p align="center">
  <img src="https://github.com/qweeze/pg_diagram/raw/master/diagram.png?raw=true" alt="diagram image"/>
</p>
