Skip to main content

A static analysis tool for postgresql databases

Project description

dblinter

Static conformity is largely used in the dev world but there is no such tool for databases schemas. This tool connect to a postgres database to check good practices in schema design and output a file in Sarif format. A configuration file describe the rule to enforce and acceptable threshold

Launch dblinter

Docker

You can use the docker image if you prefer not to install python on your computer.

Launch the docker image

docker run --rm  decathlon/dblinter:latest  --dbname $PGDATABASE --host $PGHOST --user $PGUSER --password $PGPASSWORD --port $PGPORT

Usage

 Usage: python -m dblinter [OPTIONS]

╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --user      -U      TEXT                                                 pg username [env var: PGUSER] [default: None]         │
│                                                                             [required]                                            │
│ *  --password  -W      TEXT                                                 pg pwd     [env var: PGPASSWORD] [default: None]      │
│                                                                             [required]                                            │
│ *  --host      -h      TEXT                                                 pg hostname [env var: PGHOST] [default: None]         │
│                                                                             [required]                                            │
│    --port      -p      TEXT                                                 pg port [env var: PGPORT] [default: 5432]             │
│ *  --dbname    -d      TEXT                                                 pg dbname  [env var: PGDATABASE] [default: None]      │
│                                                                             [required]                                            │
│    --sslmode   -s      [allow|prefer|require|verify-ca|verify-full|simple|  pg sslmode                 [env var: PGSSLMODE]       │
│                        disable]                                             [default: SslMode.disable]                            │
│    --describe  -b      TEXT                                                 describe is added in sarif invocation field           │
│                                                                             [default: None]                                       │
│    --filename  -f      TEXT                                                 rules configuration file                              │
│    --append    -a                                                           sarif report is append to output file [default: True] │
│    --output    -o      TEXT                                                 report output file [default: None]                    │
│    --loglevel  -l      [DEBUG|INFO|WARNING|ERROR|CRITICAL]                  log level [default: LogLevels.warning]                │
│    --schema    -n      TEXT                                                 tables in schema only filter                          │
│    --exclude   -x      TEXT                                                 Exclude table filter                                  │
│    --include   -i      TEXT                                                 Include table filter                                  │
│    --quiet     -q                                                           Quiet mode [env var:QUIET]                            │
│    --help                                                                   Show this message and exit.                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Contributing

We welcome contributions from the community. For more details on contributing to the project (including requirements), please refer to "Getting Started with Contributing."

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

dblinter-0.2.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

dblinter-0.2.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file dblinter-0.2.1.tar.gz.

File metadata

  • Download URL: dblinter-0.2.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for dblinter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5590cacb79b2615aa9f6d5f5766766be22728674ae55f1ad7b19b8364c3a5bc4
MD5 8f2c2cc6b6aa9c30302342abb1a31749
BLAKE2b-256 22bb6c45e1bd7a9ad53e421cceca2efb2edf2553e1ecc8dffa6884ae56752a4b

See more details on using hashes here.

File details

Details for the file dblinter-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dblinter-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for dblinter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5199d401077032c54e0011936af272c8831ea89daf7b176affb0e4b229b254b2
MD5 5edb064eb8716fdd6646164aa411a6ae
BLAKE2b-256 d5fee9feeddc3e32b0d9d609c2e2439eb5f33c93f53bbcf8c256a01b785b2a3f

See more details on using hashes here.

Supported by

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