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:
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
Built Distribution
File details
Details for the file dblinter-0.2.4.tar.gz
.
File metadata
- Download URL: dblinter-0.2.4.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57480833c72559a43034b3e2d36f808a9ee8885374725ef10622e90edbe91f1c |
|
MD5 | 00150f34a11bec14902c2fc1b184b0cb |
|
BLAKE2b-256 | b756cce19d114da1218cb168288d5a7da6081391e458a654559c629a0a6b2f23 |
Provenance
The following attestation bundles were made for dblinter-0.2.4.tar.gz
:
Publisher:
release.yaml
on Decathlon/dblinter
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dblinter-0.2.4.tar.gz
- Subject digest:
57480833c72559a43034b3e2d36f808a9ee8885374725ef10622e90edbe91f1c
- Sigstore transparency entry: 152409203
- Sigstore integration time:
- Predicate type:
File details
Details for the file dblinter-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: dblinter-0.2.4-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 289ccef024de3bbe4974bdd55994cc2478d37c94afba32fc5c147cccb997e5cf |
|
MD5 | 52af2fcbf943960e7bab17e5a4ffa0d0 |
|
BLAKE2b-256 | 01e2edbc2aa6e1eb3be98311d73e9a57bdbf626a222989ac464e0b69460b01fd |
Provenance
The following attestation bundles were made for dblinter-0.2.4-py3-none-any.whl
:
Publisher:
release.yaml
on Decathlon/dblinter
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dblinter-0.2.4-py3-none-any.whl
- Subject digest:
289ccef024de3bbe4974bdd55994cc2478d37c94afba32fc5c147cccb997e5cf
- Sigstore transparency entry: 152409204
- Sigstore integration time:
- Predicate type: