PostgreSQL metadata grabber and comparer
Project description
Description
PostgreSQL metadata (DDL) grabber and database schema diff
Dependencies
Installation
pip install psycopg2-binary pg-metadata
Grabbing
1 ) Create config file with connection params and other settings:
{
"connect": {
"host": "localhost",
"port": 5432,
"database": "db",
"username": "some_user",
"password": "some_password"
},
"path": "/some/path/to/grabber/result/folder",
"exclude_schemas": [
"information_schema",
"pg_catalog"
],
"threads": 8
}
2 ) By default script opens config file config_grab.json
from the same directory as zzz_Grabber.py
file.
3 ) Alternatively you can specify path to config file as a first run parameter.
4 ) Run grabber:
# Run with default config (config_grab.json)
python "zzz_Grabber.py"
# Run with specified config file path
python "zzz_Grabber.py" "/some/path/to/config.json"
Compare (diff) databases
1 ) Create config file with connection params and other settings:
{
"source": {
"host": "localhost",
"port": 5432,
"database": "db_from",
"username": "user",
"password": "password"
},
"target": {
"host": "localhost",
"port": 5432,
"database": "db_to",
"username": "user",
"password": "password"
},
"path": "/some/path/to/compare/result/folder",
"exclude_schemas": [
"information_schema",
"pg_catalog"
]
}
2 ) By default script opens config file config_diff.json
from the same directory as zzz_Grabber.py
file.
3 ) Alternatively you can specify path to config file as a first run parameter.
4 ) Run diff:
# Run with default config (config_grab.json)
python "zzz_Diff.py"
# Run with specified config file path
python "zzz_Diff.py" "/some/path/to/config.json"
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pg_metadata-1.1.13.tar.gz
(21.1 kB
view hashes)
Built Distribution
Close
Hashes for pg_metadata-1.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da91ff75a58dea335afcf41aeba61613360622955cef39af2c17963e8a0e4fe |
|
MD5 | 7dd9c469afab601db45d4ce8c7a1c450 |
|
BLAKE2b-256 | 3e07c10904bd74807a4c6d151200d462d3e9d929191dff85b50d206b8105ecc7 |