pysql-console

Command line emulator written in Python


Project maintained by jsarnowski96 Hosted on GitHub Pages — Theme by mattgraham
                         _____   __ __   __  _      ___ __  __  _   __   __  _   ___  
                        | _,\ `v' /' _/ /__\| | __ / _//__\|  \| |/' _/ /__\| | | __| 
                        | v_/`. .'`._`.| \/ | ||__| \_| \/ | | ' |`._`.| \/ | |_| _|  
                        |_|   !_! |___/ \_V_\___|  \__/\__/|_|\__||___/ \__/|___|___|
                                                                           v.0.3.0.2

PySql-Console (under development)

Command line emulator written in Python 3.x

Table of contents

Introduction
Current features
Planned features
File structure and dependant methods listing
Requirements
List of available commands
List of commands’ aliases
CLI’s interactive mode
To do
Known issues
Release notes

Introduction

PySql-Console is a simple program emulating the command line interface, designed to interact with MS SQL environment. Due to Python’s limitations related to internal command execution, some of the features introduced in this program are a sort of workarounds (for example user authentication system or multiple input() parameters treated as a separate strings kept in list() object). Thus the code might look a bit groggy and unsophisticated in some places, but during the development process I’m going to polish some things up.

PySql-Console allows user to interact with MS SQL database and its content. In future I’m going to implement other features like SQL-XML converter, text editor or even system-wide operations’ support.

Current features:

Planned features:

File structure and dependant methods listing:

Requirements:

List of available commands:

add <table>: Add new record to the selected table
clear: This command clears the console window
close: Close active connection to the database
connect <server> <database>: Open new connection to the target database
da <file_name> <param>: Execute a Data Analysis over the given CSV file - optional parameter determines the exact method - if it is not provided, the default method describe() weill be executed.
databases: Display list of all databases within the selected MS SQL Server instance
delete <table> <rowId>: Remove the existing record from the selected table
drop <table>: Drop the selected table
edit <table> <rowId>: Modify the existing record in the selected table
exit - Exit the program
export <table>: Exports currently selected table to .csv file
help: Displays the list of available commands
import <destination_table> <file_name>: Import existing CSV file into the selected database
list: Display list of tables in the selected database
logout: Return to splash screen
metrics: Display CPU/Memory usage of MS SQL Server
query: Run a specific query in the database
show: List all rows in the selected table
status: Displays current session's data
switch <table>: If no new table name is provided, remove focus from the current table, otherwise switch to the another table
xml <table>: Export selected table into the pre-formatted XML file


List of commands’ aliases:

exp: export command alias
quit: exit command alias
del: delete command alias


CLI’s interactive mode:

Commands with implemented interactive mode allows user to provide the additional parameters “on the run” - in case of not providing any of the specified parameters or just a part of them. For example:

js $ export users
There is no connection established. Redirecting to connect action...

Server name: localhost
Database: test_db
Successfully connected to the localhost->test_db

js $ export users
users.csv export task finished successfully.

js $

Result:

To do:

Known issues:

Release notes: