Giter VIP home page Giter VIP logo

sql-validator's Introduction

sql_validator


What is it?

sql_validator is a CLI Python package that validates and format SQL(postgres) queries.

Prerequisites

Before using this package make sure that you have a postgres database either on the local server or remote server, and have some data in it.

Installation

To install this package, run the following command.

pip install git+https://github.com/Ahmad-Wahid/sql-validator

Usage

  1. Create an environment file .env, and update the following DB variables.

    DB_NAME = database_name
    DB_USER = database_user
    DB_PASSWORD = database_password
    DB_HOST = ip_address
    DB_PORT = port
    
  2. To run the validation script, there are two options. You can either pass a single query or file of multiple queries.

    • For passing a single query, run the following command.

      sql_validator --query "pass your query here"
    • For passing a file with .sql extension, run the following command.

      sql_validator --file path/to/file-name.sql

      Make sure that, there is a semicolon at the end of every query.

sql-validator's People

Contributors

ahmad-wahid avatar

Watchers

 avatar

sql-validator's Issues

if metadata is passed, then consider all its queries

By default, we have a loop on user queries file, but in case metadata is passed then it's better to consider its all queries. I mean loop over them and compared each result with user's query from the file.

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.