Tool to scan SQL for antipatterns and generate reports with remediation steps
Project description
SQL Antipattern Scanner
SQL Antipattern Scanner is a powerful tool that scans SQL files/queries for antipatterns and generates comprehensive reports in various formats.
Installation
To install SQL Antipattern Scanner, simply run:
pip install sql-antipattern-scanner
Usage
After installation, you can use SQL Antipattern Scanner from the command line:
sql-antipattern-scanner [arguments]
Available arguments are:
sql_file(positional argument): Path to the SQL file to scan. Optional if--queryoption is used.--query: SQL query string to scan directly. If provided,sql_fileargument is not required.--format: Output format for the report. Options:json,csv,html. Default:json.--output: Output file path for the report. If not provided, prints to console.--run-tests: Flag to run unit tests for SQL Antipattern Scanner.
General syntax:
sql-antipattern-scanner [sql_file] [--query QUERY] [--format FORMAT] [--output OUTPUT] [--run-tests]
Note: If both sql_file and --query are provided, the tool will prioritize the --query option.
Examples
-
Scan SQL file and print report to console:
sql-antipattern-scanner path/to/your/sql_file.sql -
Scan SQL query and save report in HTML format:
sql-antipattern-scanner --query "SELECT * FROM users WHERE id = 1" --format html --output report.html -
Scan SQL file and save report in CSV format:
sql-antipattern-scanner path/to/your/sql_file.sql --format csv --output report.csv -
Run unit tests and scan SQL file, saving report in JSON format:
sql-antipattern-scanner path/to/your/sql_file.sql --run-tests --output report.json -
Run unit tests only:
sql-antipattern-scanner --run-tests
Features
- Detects a wide range of SQL antipatterns
- Generates detailed reports with severity levels and suggestions for improvement
- Supports multiple output formats for easy integration into your workflow
- Fast and efficient scanning of large SQL files
- Includes comprehensive unit tests to ensure reliability
License
This project is licensed under the MIT License - see the LICENSE file for details.
© 2024 Nicholas G. Piesco. All rights reserved.
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 sql_antipattern_scanner-0.1.3.tar.gz.
File metadata
- Download URL: sql_antipattern_scanner-0.1.3.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b660e7b50d853886a8ed9d5456fbc058b41ab6ff41af4c5ae8864d9205c2153
|
|
| MD5 |
aa321f045c8c6f1ab1efd51787ff7fe1
|
|
| BLAKE2b-256 |
986312d0e005a1dbe403a85d80bbc461ef4e4cc5c26f02acb963435ed845a702
|
File details
Details for the file sql_antipattern_scanner-0.1.3-py3-none-any.whl.
File metadata
- Download URL: sql_antipattern_scanner-0.1.3-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a0e99f0f17243f683aef42728748cf8590438fb9e098f5896c12a11f976c636
|
|
| MD5 |
53203f6bcfdfc5de44dc11aaeae69401
|
|
| BLAKE2b-256 |
4eb2c38a4fb65e5f185644bba9c44c08bf91889d709f0bb8ff9154c768cf668e
|