Environments#

JupyterLab and JupySQL#

Install SQLAlchemy and JupySQL

pip install sqlalchemy-exasol
pip install jupysql

Connect to Exasol database using SQLAlchemy

import sqlalchemy
from sqlalchemy.engine.url import URL
import getpass

db_host = 'my_exasol_host'
db_port = 8563
db_username = input('User Name:')
db_password = getpass.getpass('Password:')

websocket_url = URL.create(
    'exa+websocket',
    host=db_host,
    port=db_port,
    username=db_username,
    password=db_password
)

db_engine = sqlalchemy.create_engine(websocket_url)

Enable the Jupyter SQL Extension

%load_ext sql
%sql db_engine

Run queries against Exasol

%%sql
SELECT * FROM "FLIGHTS"."AIRLINE" LIMIT 10

Positron#

You can either connect to Exasol with pyexasol as described in Getting Started or using JupySQL as described in JupyterLab and JupySQL.

pyCharm#

Please follow the instructions of the official documentation of pyCharm.

VS Code#

To connect to Exasol install the plugin Database Client JDBC from the marketplace.