Skip to main content

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 --query option is used.
  • --query: SQL query string to scan directly. If provided, sql_file argument 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

  1. Scan SQL file and print report to console:

    sql-antipattern-scanner path/to/your/sql_file.sql
    
  2. Scan SQL query and save report in HTML format:

    sql-antipattern-scanner --query "SELECT * FROM users WHERE id = 1" --format html --output report.html
    
  3. Scan SQL file and save report in CSV format:

    sql-antipattern-scanner path/to/your/sql_file.sql --format csv --output report.csv
    
  4. 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
    
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sql_antipattern_scanner-0.1.3.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

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

sql_antipattern_scanner-0.1.3-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

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

Hashes for sql_antipattern_scanner-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4b660e7b50d853886a8ed9d5456fbc058b41ab6ff41af4c5ae8864d9205c2153
MD5 aa321f045c8c6f1ab1efd51787ff7fe1
BLAKE2b-256 986312d0e005a1dbe403a85d80bbc461ef4e4cc5c26f02acb963435ed845a702

See more details on using hashes here.

File details

Details for the file sql_antipattern_scanner-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sql_antipattern_scanner-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0e99f0f17243f683aef42728748cf8590438fb9e098f5896c12a11f976c636
MD5 53203f6bcfdfc5de44dc11aaeae69401
BLAKE2b-256 4eb2c38a4fb65e5f185644bba9c44c08bf91889d709f0bb8ff9154c768cf668e

See more details on using hashes here.

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