dblinter


Namedblinter JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/decathlon/dblinter
SummaryA static analysis tool for postgresql databases
upload_time2024-11-29 09:27:36
maintainerNone
docs_urlNone
authorStephane Defenin
requires_python<4.0,>=3.12
licenseApache-2.0
keywords postgresql static analysis sonar sarif code quality sql database
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 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][2] format.
A configuration file describe the rule to enforce and acceptable threshold

An example of the output is: ![dblinter output](docs/dblinter-output.png)

## Launch dblinter

### Docker

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

Launch the docker image

```sh
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:

```shell
# 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

```shell

 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](CONTRIBUTING.md)."

<!--
Links
-->
[2]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/decathlon/dblinter",
    "name": "dblinter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "postgresql, static analysis, sonar, sarif, code quality, sql, database",
    "author": "Stephane Defenin",
    "author_email": "stephane.defenin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b7/56/cce19d114da1218cb168288d5a7da6081391e458a654559c629a0a6b2f23/dblinter-0.2.4.tar.gz",
    "platform": null,
    "description": "# dblinter\n\nStatic conformity is largely used in the dev world but there is no such tool for databases schemas.\nThis tool connect to a postgres database to check good practices in schema design and output a file in [Sarif][2] format.\nA configuration file describe the rule to enforce and acceptable threshold\n\nAn example of the output is: ![dblinter output](docs/dblinter-output.png)\n\n## Launch dblinter\n\n### Docker\n\nYou can use the docker image if you prefer not to install python on your computer.\n\nLaunch the docker image\n\n```sh\ndocker run --rm -t decathlon/dblinter:latest  --dbname $PGDATABASE --host $PGHOST --user $PGUSER --password $PGPASSWORD --port $PGPORT\n```\n\n## Directly from the source\n\nYou can launch dblinter directly from the source code. You will need python and poetry to install the dependencies:\n\n```shell\n# Install poetry\ncurl -sSL https://install.python-poetry.org | python3 -\n# Install dependencies\npoetry install --with dev\n# Launch the program\npoetry run python -m dblinter --dbname $PGDATABASE --host $PGHOST --user $PGUSER --password $PGPASSWORD --port $PGPORT\n```\n\n## Usage\n\n```shell\n\n Usage: python -m dblinter [OPTIONS]\n\n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 *  --user      -U      TEXT                                                 pg username [env var: PGUSER] [default: None]         \u2502\n\u2502                                                                             [required]                                            \u2502\n\u2502 *  --password  -W      TEXT                                                 pg pwd     [env var: PGPASSWORD] [default: None]      \u2502\n\u2502                                                                             [required]                                            \u2502\n\u2502 *  --host      -h      TEXT                                                 pg hostname [env var: PGHOST] [default: None]         \u2502\n\u2502                                                                             [required]                                            \u2502\n\u2502    --port      -p      TEXT                                                 pg port [env var: PGPORT] [default: 5432]             \u2502\n\u2502 *  --dbname    -d      TEXT                                                 pg dbname  [env var: PGDATABASE] [default: None]      \u2502\n\u2502                                                                             [required]                                            \u2502\n\u2502    --sslmode   -s      [allow|prefer|require|verify-ca|verify-full|simple|  pg sslmode                 [env var: PGSSLMODE]       \u2502\n\u2502                        disable]                                             [default: SslMode.disable]                            \u2502\n\u2502    --describe  -b      TEXT                                                 describe is added in sarif invocation field           \u2502\n\u2502                                                                             [default: None]                                       \u2502\n\u2502    --filename  -f      TEXT                                                 rules configuration file                              \u2502\n\u2502    --append    -a                                                           sarif report is append to output file [default: True] \u2502\n\u2502    --output    -o      TEXT                                                 report output file [default: None]                    \u2502\n\u2502    --loglevel  -l      [DEBUG|INFO|WARNING|ERROR|CRITICAL]                  log level [default: LogLevels.warning]                \u2502\n\u2502    --schema    -n      TEXT                                                 tables in schema only filter                          \u2502\n\u2502    --exclude   -x      TEXT                                                 Exclude table filter                                  \u2502\n\u2502    --include   -i      TEXT                                                 Include table filter                                  \u2502\n\u2502    --quiet     -q                                                           Quiet mode [env var:QUIET]                            \u2502\n\u2502    --help                                                                   Show this message and exit.                           \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\n```\n\n## Contributing\n\nWe welcome contributions from the community. For more details on contributing to the project (including requirements), please refer to \"[Getting Started with Contributing](CONTRIBUTING.md).\"\n\n<!--\nLinks\n-->\n[2]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A static analysis tool for postgresql databases",
    "version": "0.2.4",
    "project_urls": {
        "Homepage": "https://github.com/decathlon/dblinter",
        "Repository": "https://github.com/decathlon/dblinter"
    },
    "split_keywords": [
        "postgresql",
        " static analysis",
        " sonar",
        " sarif",
        " code quality",
        " sql",
        " database"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01e2edbc2aa6e1eb3be98311d73e9a57bdbf626a222989ac464e0b69460b01fd",
                "md5": "52af2fcbf943960e7bab17e5a4ffa0d0",
                "sha256": "289ccef024de3bbe4974bdd55994cc2478d37c94afba32fc5c147cccb997e5cf"
            },
            "downloads": -1,
            "filename": "dblinter-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52af2fcbf943960e7bab17e5a4ffa0d0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 39449,
            "upload_time": "2024-11-29T09:27:34",
            "upload_time_iso_8601": "2024-11-29T09:27:34.238897Z",
            "url": "https://files.pythonhosted.org/packages/01/e2/edbc2aa6e1eb3be98311d73e9a57bdbf626a222989ac464e0b69460b01fd/dblinter-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b756cce19d114da1218cb168288d5a7da6081391e458a654559c629a0a6b2f23",
                "md5": "00150f34a11bec14902c2fc1b184b0cb",
                "sha256": "57480833c72559a43034b3e2d36f808a9ee8885374725ef10622e90edbe91f1c"
            },
            "downloads": -1,
            "filename": "dblinter-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "00150f34a11bec14902c2fc1b184b0cb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 25985,
            "upload_time": "2024-11-29T09:27:36",
            "upload_time_iso_8601": "2024-11-29T09:27:36.035641Z",
            "url": "https://files.pythonhosted.org/packages/b7/56/cce19d114da1218cb168288d5a7da6081391e458a654559c629a0a6b2f23/dblinter-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-29 09:27:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "decathlon",
    "github_project": "dblinter",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "dblinter"
}
        
Elapsed time: 1.97927s