Giter VIP home page Giter VIP logo

auto-reports-sql's Introduction

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

auto-reports-sql's People

Contributors

naveeng2402 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.