https://github.com/alicebob/schemaspy
Read Postgres schema definitions in Go.
https://github.com/alicebob/schemaspy
database go postgresql schema
Last synced: about 1 year ago
JSON representation
Read Postgres schema definitions in Go.
- Host: GitHub
- URL: https://github.com/alicebob/schemaspy
- Owner: alicebob
- License: mit
- Created: 2017-02-11T09:17:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-27T17:03:04.000Z (over 9 years ago)
- Last Synced: 2025-04-10T19:29:58.964Z (about 1 year ago)
- Topics: database, go, postgresql, schema
- Language: Go
- Size: 18.6 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What
Schemaspy gets a schema from a PostgreSQL server as a simple Go datastructure.
It describes which tables there are, their columns, &c. Schemaspy only reads; any changes to the database need to be done by
other means, such as `ALTER TABLE`.
# Use cases
how this is used:
- a maintenance script which creates and archives partitioned tables. It needs to know which tables are there already, and which need to be created or have an outdated definition.
- to compare on deployment the current database (as returned by schemaspy) against the wanted state, so the deploy process can warn about missing database changes.
# Test
The tests need access to a PostgreSQL server, with a database `schemaspy`:
# su -c "createuser -DRS yourusername" postgres
# su -c "createdb -O yourusername schemaspy" postgres
$ make int