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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dblinter-0.4.8.tar.gz.
File metadata
- Download URL: dblinter-0.4.8.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5c6df5e54ee7cefc1aa232d09e4d21242d399f51026b9f81062e413b5b794a
|
|
| MD5 |
08f6e2234e05f583caebf8df36dcce58
|
|
| BLAKE2b-256 |
7014131dac46683445b7382399600e769ac23e91a92b761225d4b17065a2a208
|
Provenance
The following attestation bundles were made for dblinter-0.4.8.tar.gz:
Publisher:
release.yaml on Decathlon/dblinter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dblinter-0.4.8.tar.gz -
Subject digest:
ed5c6df5e54ee7cefc1aa232d09e4d21242d399f51026b9f81062e413b5b794a - Sigstore transparency entry: 659165374
- Sigstore integration time:
-
Permalink:
Decathlon/dblinter@78a56ceb46584c1d7b584dd519e812cf2fd3c0a7 -
Branch / Tag:
refs/tags/0.4.8 - Owner: https://github.com/Decathlon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@78a56ceb46584c1d7b584dd519e812cf2fd3c0a7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dblinter-0.4.8-py3-none-any.whl.
File metadata
- Download URL: dblinter-0.4.8-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2230a5d2edb8b830853eb7452eb1b9f511c1ef15968d8e6846d356dd29a0aa91
|
|
| MD5 |
6443deb64a73b2e9cbabc99cfb61a7c8
|
|
| BLAKE2b-256 |
ff001e31c18971c191f1570db28aba2e2e94b857f67c4c5ac6fdea6f6c7064c5
|
Provenance
The following attestation bundles were made for dblinter-0.4.8-py3-none-any.whl:
Publisher:
release.yaml on Decathlon/dblinter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dblinter-0.4.8-py3-none-any.whl -
Subject digest:
2230a5d2edb8b830853eb7452eb1b9f511c1ef15968d8e6846d356dd29a0aa91 - Sigstore transparency entry: 659165381
- Sigstore integration time:
-
Permalink:
Decathlon/dblinter@78a56ceb46584c1d7b584dd519e812cf2fd3c0a7 -
Branch / Tag:
refs/tags/0.4.8 - Owner: https://github.com/Decathlon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@78a56ceb46584c1d7b584dd519e812cf2fd3c0a7 -
Trigger Event:
release
-
Statement type: