Giter Site home page Giter Site logo

devansh3712 / pysql Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 4.0 236 KB

Python wrapper for making MySQL queries easier

Home Page: https://pypi.org/project/pysql-cli/

License: MIT License

Python 99.69% Shell 0.17% Makefile 0.14%
python mysql cli hacktoberfest hacktoberfest2022

pysql's Introduction

PySQL

Python wrapper for making MySQL queries easier to execute


Installation

  • Clone the repository to your local machine
git clone https://github.com/Devansh3712/PySQL.git
  • Installation pre-requisites

    • MySQL local server
  • PyPi package

Windows

pip install pysql-cli

Linux / MacOS

pip3 install pysql-cli
  • Automatic Installation

Open the PySQL directory and run the install file

Windows

install.bat

Linux / MacOS

chmod +x ./install.sh
./install.sh
  • Manual Setup

Open the PySQL directory

using requirements.txt

pip install -r requirements.txt

Usage

  • Using the pip package

    • pysql: Basic PySQL CLI
    • cpysql: Colored PySQL CLI
pysql
cpysql
  • Using the Python command-line wrapper .py file

    • main.py: Basic PySQL CLI
    • main_c.py: Colored PySQL CLI

Windows

python pysql/main.py
python pysql/main_c.py

Linux

python3 pysql/main.py
python3 pysql/main_c.py

Commands

List of available commands

ALL COMMANDS

    select              TB_NAME, COLUMNS, ARGS      Displays selected columns of a table
    insert      -s      TB_NAME, ARGS               Insert a single row in a table
                -m      TB_NAME, NUM, ARGS          Insert `NUM` rows in a table
                -f      TB_NAME, FILE_NAME          Insert values in a table from CSV file
    update              TB_NAME, COLUMNS, ARGS      Updates values of columns in a table
    delete              TB_NAME, COLUMN             Deletes values of row in a table
    showdb                                          Display all databases in MySQL server
    usedb                                           Use a database
    createdb            DB_NAME                     Create a new database
    dropdb              DB_NAME                     Delete a database
    showtb                                          Display all tables in current db
    createtb            TB_NAME, ARGS               Create a new table in current db
    droptb              TB_NAME                     Delete a table in current db
    trunctb             TB_NAME                     Truncate a table in current db
    desctb              TB_NAME                     Display structure of a table in current db
    altertb             TB_NAME, ARGS               Alter contents of table in current db
    exportdb            DB_NAME, PATH               Export db as `.sql` file to path
    exporttb    -json   TB_NAME, PATH               Export table as `.txt` file to path
                -csv    TB_NAME, PATH               Export table as `.csv` file to path
                -sql    TB_NAME, PATH               Export table schema as `.sql` file to path
    exportall   -json   PATH                        Export all tables in db as `.txt` file to path
                -csv    PATH                        Export all tables in db as `.csv` file to path
                -sql    PATH                        Export all tables schema in db as `.sql` file to path
    importdb            DB_NAME, PATH               Import `.sql` file into input database
    importtb            DB_NAME, PATH               Import `.sql` table schema into input table

pysql's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar devansh3712 avatar tejaswamishra22 avatar thebjork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pysql's Issues

No blank lines allowed after function docstring

Description

There shouldn't be any blank lines after the function docstring. Remove the blank lines to fix this issue. #### Not preferred: python def example(): '''Bad docstring.''' pass #### Preferred: python def example(): '''Good docstring.''' pass

Occurrences

There are 16 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/Devansh3712/PySQL/issue/FLK-D202/occurrences/

No blank lines allowed before class docstring

Description

There shouldn't be any blank lines before the class docstring. Remove the blank lines to fix this issue. #### Not preferred: python class Example: '''Bad docstring.''' #### Preferred: python class Example: '''Good docstring.'''

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/Devansh3712/PySQL/issue/FLK-D211/occurrences/

Inconsistent return statements

Description

According to PEP8, if any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable). Good: ```python def foo(x): if x >= 0: return …

Occurrences

There are 2 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/Devansh3712/PySQL/issue/PYL-R1710/occurrences/

No blank lines allowed before function docstring

Description

There shouldn't be any blank lines before the function docstring. Remove the blank lines to fix this issue. #### Not preferred: python def example(): '''Bad docstring.''' ... #### Preferred: python def example(): '''Good docstring.''' ...

Occurrences

There are 16 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/Devansh3712/PySQL/issue/FLK-D201/occurrences/

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.