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

An example of the output is: dblinter output

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 -t decathlon/dblinter:latest  --dbname $PGDATABASE --host $PGHOST --user $PGUSER --password $PGPASSWORD --port $PGPORT

Directly from the source

You can launch dblinter directly from the source code. You will need python and poetry to install the dependencies:

# Install poetry
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install --with dev
# Launch the program
poetry run python -m dblinter --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.5.2.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

dblinter-0.5.2-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dblinter-0.5.2.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dblinter-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3306ffdd573ed5ae7aa32461c53823e620f522684a7f6e9f35a899d2116be1ba
MD5 0ea46d04bbe3d7653e84e5c17108fe80
BLAKE2b-256 8a2d24221ed16c2d4ae0b41f8a75914f8e6533f8dfa1ba4a8969bd1a33f32ef6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dblinter-0.5.2.tar.gz:

Publisher: release.yaml on Decathlon/dblinter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dblinter-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dblinter-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 380567e3013542b86a9de2ada0e7a3a261f4da5e1d9a202ceb7b1dd5022b60c5
MD5 5a29a922ee32877db82066c04c3e9f05
BLAKE2b-256 b60d619b9665ecb4488f570f98d49e08db87e6caddd6ab6dbc0e2bdf282ad4af

See more details on using hashes here.

Provenance

The following attestation bundles were made for dblinter-0.5.2-py3-none-any.whl:

Publisher: release.yaml on Decathlon/dblinter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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