Scheman is a tool to visualize tables schema or ERD of connected RDB.
Main purpose of this is accelerating working collaboration between engineers and non-engineers.
You can choose output destination from Notion, File or both of them.
Here is examples for output.
https://github.com/maru44/scheman/blob/master/testdata/postgres/def.csv
https://github.com/maru44/scheman/blob/master/testdata/postgres/erd.md
| Database | Test Confirmed |
|---|---|
| PostgreSQL | 👌 |
| MySQL | 👌 |
| MSSQL Server | |
| SQLite3 | |
| CockroachDB |
Only Notion is supported as output destination now. But I am going to add output destination like spread-sheat.
| Output Destination | Test Confirmed |
|---|---|
| Notion | 👌 |
| File | 👌 |
Install this package and write settings for connection.
installation
go install github.com/maru44/[email protected]
example for PostgreSQL - Notion)
go install github.com/volatiletech/sqlboiler/v4/drivers/[email protected] \
&& scheman psql --services notion --erd-outputs notion \
--notion-token ${NOTION_TOKEN} --notion-page-id ${PSQL_NOTION_PAGE_ID}
If you want to overwrite your schema-definition tables or ERD, you have to set notion-table-index after this command done. This value is oututted in your command line.
example for MySQL - File with sqlboiler.toml)
go install github.com/volatiletech/sqlboiler/v4/drivers/[email protected] \
&& scheman mysql -c sqlboiler.toml --def-file def.csv --erd-file erd.md
| Name | Defaults | |
|---|---|---|
| config | "scheman" | if you use sqlboiler, you can use sqlboiler.toml(.yaml) with setting this "sqlboiler.toml(.yaml)" |
| services | [ ] | notion |
| erd-outputs | [ ] | notion |
| notion-page-id | "" | required if output destinations contain "notion" |
| notion-page-token | "" | required if output destinations contain "notion" |
| notion-table-index | "" | if you want to overwrite definition table, please fill this |
| def-file | "" | The file name. required if output destinations if you want to output tables schema to file |
| erd-file | "" | The file name. required if output destinations if you want to output ERD to file |
| disable-views | false | |
| attr-ignore | [ ] |
Settings for database you want to connect.
| Name | Required | Postgres Default | MySQL Default | MSSQL Default |
|---|---|---|---|---|
| schema | no | "public" | none | "dbo" |
| dbname | yes | none | none | none |
| host | yes | none | none | none |
| port | no | 5432 | 3306 | 1433 |
| user | yes | none | none | none |
| pass | no | none | none | none |
| sslmode | no | "require" | "true" | "true" |
| whitelist | no | [] | [] | [] |
| blacklist | no | [] | [] | [] |
ref: https://github.com/volatiletech/sqlboiler#database-driver-configuration