Skip to main content

CLI for making MySQL queries easier

Project description

PySQL

GUI & Python wrapper for making MySQL queries easier


Installation

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

    • MySQL server
    • Python virtualenv
  • PyPi package

Windows

> pip install pysql-cli

Linux / MacOS

$ pip3 install pysql-cli
  • Automatic Setup

Open the PySQL directory, run the setup file & activate the virtual environment

Windows

> setup.cmd
> venv\Scripts\activate.bat

Linux / MacOS

$ chmod +x ./setup.sh
$ . setup.sh
$ source venv/bin/activate
  • Manual Setup

Open the PySQL directory

using requirements.txt

$ pip install -r requirements.txt

using poetry

$ poetry install

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  -txt  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 -txt  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

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

pysql-cli-1.0.1.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

pysql_cli-1.0.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pysql-cli-1.0.1.tar.gz.

File metadata

  • Download URL: pysql-cli-1.0.1.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pysql-cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cce0bdbad25a9df6881adeb02e779603de05a989af425753f617a3e020fc2472
MD5 7eb6089fc75c92cc830f746731e10248
BLAKE2b-256 625f977421a622358fbf28829aac7ece1be0f48cbfc98b3970d18c52ea985f6d

See more details on using hashes here.

File details

Details for the file pysql_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pysql_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pysql_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0a8be6c2c6da4b4af25f3ceaa2a794c7f677f55d1863671c4ab5648fa4a80e2
MD5 f0a1c201fd2108c6bccff5bc2083e376
BLAKE2b-256 955ec28ce7de2be72d7f5f5f5917f8ab8cb6d0ea2f98bb192b1b53304296a784

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page