jupyterlab-sql adds a SQL user interface to JupyterLab:
- explore your tables with a point-and-click interface
- read and modify your database with custom queries
To install jupyterlab-sql, run the following commands:
pip install jupyterlab_sql
jupyter serverextension enable jupyterlab_sql --py --sys-prefix
jupyter lab build
You will then need to restart any running Jupyter servers.
jupyterlab-sql only works with Python 3.5 and above.
To install jupyterlab-sql on versions of JupyterLab pre 1.0, run:
pip install jupyterlab_sql==0.2.1
jupyter serverextension enable jupyterlab_sql --py --sys-prefix
jupyter lab build
There is a SQL icon in the launcher (File > New Launcher):
You can also launch a session from the command palette: search for SQL.
The connection URL needs to be a valid database URL. Follow the SQLAlchemy guide on database URLs.
Press shift
+ enter
or ctrl
+ enter
while in the main query
area to dispatch the statement.
jupyterlab-sql has been extensively tested against SQLite, PostgreSQL, and MySQL databases.
Other databases supported by sqlalchemy may also work.
The lifetime of a SQLite in-memory database is tied to the lifetime of the Jupyter server. Restarting the Jupyter server will clear any data in your in-memory database.
Report issues using the issue tracker.
Contributions are welcome. If you have not developed JupyterLab extensions before, I recommend following this tutorial.