Skip to main content

This tool automates SQL Reports generation.

Project description

SQL Automation

This is a simple tool to run a set of sql queries and generate a HTML report of the results

How to use the tool

Install the tool using pip

pip install auto-reports-sql

Create a json file with the following schema

{
  "type": "array",
  "items": {
    "type": "object",
    "required": ["name", "query"],
    "properties": {
      "name": {
        "type": "string",
        "pattern": "^.*$"
      },
      "query": {
        "type": "array",
        "items": {
          "type": "string",
          "pattern": "^.*$"
        }
      }
    }
  }
}

Example

[
  {
    "name": "First 10 data",
    "query": [
      "select * from Person limit 10",
      "select * from Person order by name desc limit 10"
    ]
  }
]

Run the program with the following command

Usage: auto-reports-sql execute [OPTIONS] QUERIES

Options:
  -t, --threads INTEGER           No. of threads used for computation
                                  [default: 10]
  -rt, --report-title TEXT        Title of the generated report.  [default: Report Title]
  -d, --db [sqlite|mysql|postgres]
                                  The database which is used.  [required]
  -dp, --db-path PATH             Sqlite database path. Only required if the
                                  database is set to 'sqlite'
  -h, --host TEXT                 host of the database. Only required if the
                                  database is not set to 'sqlite'
  -u, --username TEXT             username to access the database. Only
                                  required if the database is not set to
                                  'sqlite'
  -p, --password TEXT             password of the database. Only required if
                                  the database is not set to 'sqlite'
  -n, --db-name TEXT              name of the database. Only required if the
                                  database is not set to 'sqlite'
  --config FILE                   Read configuration from FILE.
  --help                          Show this message and exit.

Report Examples

Screenshot

Possible Updates

  • Errors in the queries are not taken into account

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

auto_reports_sql-1.0.6-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file auto_reports_sql-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_reports_sql-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 da9762e9c966afbb5154a56737f92a9f94f8ea39ffb7ee15a7236d13c643712c
MD5 4c383bb9f0f0479e045fd9821f80ccab
BLAKE2b-256 7ba69ad94291db54b925b8fd390e32d1189e6b2792aa72f3ff911f3dc37dcb98

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