A shell for interacting with SQLite databases written in Python
To clone this repository and launch the python script:
git clone https://github.com/Moritisimor/PySQLSh
cd PySQLSh
python pysqlsh.pyTo install the script, you can use pip:
git clone https://github.com/Moritisimor/PySQLSh
cd PySQLSh
pip install .
pyqsqlsh(Note: you should use pipx for this if you want to install it globally without using a virtual environment)
You should then be prompted to enter the path to a SQLite database.
If you only want to look around, you can just type :memory: to use an in-memory database.
Instead of entering the path to the database each time, you can just pass it as a CLI argument like this:
python pysqlsh.py path/to/databaseWhat's important to note is that PySQLSh uses ; to determine when input is done.
You can simply execute SQL statements with this shell.
For example, to create a table:
Insert some data:
And then query it:
PySQLSh also features a few builtins.
To see the schema of all tables:
To see the schema of a particular table:
To see all tables:
To execute a SQL script:
PySQLSh also has some other builtins that are less spectacular.
.exit to exit the database. Alternatively, you can just enter Ctrl + D with an empty prompt.
.clear to clear the screen.






