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.8.tar.gz (35.2 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.8-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: postgres_ddl-1.8.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for postgres_ddl-1.8.tar.gz
Algorithm Hash digest
SHA256 b333f11e1d421543d1d26f65373f9f5ff904479deba932c4cb1817616fe905f7
MD5 f7d9ea073f5fce18bc587a75132175fb
BLAKE2b-256 e17dab866abe7b5748cb8eb9175047ac32f8e574d4b92b37f0acc5645317874c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: postgres_ddl-1.8-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for postgres_ddl-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 82cf644f6cab3cdbf32dae4cc11df1da9d36d32e4669604e3a7a436f7bca77a1
MD5 064475e65350f1959d2279520829d34e
BLAKE2b-256 77d4e237d0f4c03da9b2e4247d386556056ef98d1e8bac2ff109321a7eb1f9f5

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