Skip to main content

PostgreSQL metadata grabber and comparer

Project description

Description

PostgreSQL metadata (DDL) grabber and database schema diff

Dependencies

Installation

pip install psycopg2-binary postgres-ddl

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,
    "new_line": "\n",
    "indent": 2
}

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postgres_ddl-1.19.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

postgres_ddl-1.19-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

Details for the file postgres_ddl-1.19.tar.gz.

File metadata

  • Download URL: postgres_ddl-1.19.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for postgres_ddl-1.19.tar.gz
Algorithm Hash digest
SHA256 3d620ce518526919ba885f7aefb3648964c4eb84902304cc5b8deb6f7b209cc9
MD5 b4fababf47b466681ba1983c19d845d7
BLAKE2b-256 10782764ff20bffa1e66b1d14548b3bb49cc484a47fdba0e14a6b4850110e686

See more details on using hashes here.

File details

Details for the file postgres_ddl-1.19-py3-none-any.whl.

File metadata

  • Download URL: postgres_ddl-1.19-py3-none-any.whl
  • Upload date:
  • Size: 56.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for postgres_ddl-1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 3b85d6d0fab21a0985e15a9d88bbdb7cc646bfa5f4daa2fe8a03e7de99954fc4
MD5 8c0d0aca6dafe805e6fe24ab5a3ed552
BLAKE2b-256 649cc66397c88661a7d25a9f00c8a5011aaf25d91a712e178253c03b237449e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page