Skip to content

Added Chapters environments and integrations #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions developer-documentation
Submodule developer-documentation added at 2fa3e1
1 change: 0 additions & 1 deletion doc/data_ingestion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Here is an example of how to load data from a CSV file stored on an HTTP server:
conn.execute("""
IMPORT INTO your_schema.your_table
FROM CSV AT 'https://your_https_server/path/to/your/file.csv'
FILE OPTIONS 'DELIMITER=; ENCODING=UTF-8 SKIP_ROWS=1 NULL=NULL'
""")

For more detailed information on loading data from external sources, please refer to the Exasol documentation:
Expand Down
62 changes: 57 additions & 5 deletions doc/environments.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,63 @@
Environments
============

Jupyter Notebooks
-----------------
.. _jupyterlab:

VSCode
------
JupyterLab and JupySQL
----------------------

Install SQLAlchemy and JupySQL

.. code-block:: python

pip install sqlalchemy-exasol
pip install jupysql

Connect to Exasol database using SQLAlchemy

.. code-block:: python

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

.. code-block:: python

%load_ext sql
%sql db_engine



Run queries against Exasol

.. code-block:: python

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

Positron
--------
--------

You can either connect to Exasol with pyexasol as described in :doc:`getting_started` or using JupySQL as described in :ref:`jupyterlab`.

pyCharm
-------

Please follow the instructions of the official documentation of `pyCharm <https://www.jetbrains.com/help/pycharm/exasol.html>`_.
53 changes: 51 additions & 2 deletions doc/integrations.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,63 @@
Integrations
============

SQLAlchemy
----------

Install SQLAlchemy

.. code-block:: python

pip install sqlalchemy-exasol


Connect to Exasol database using SQLAlchemy

.. code-block:: python

from sqlalchemy import create_engine
url = "exa+websocket://<user>:<password>@<host>:<port>/<schema>?CONNECTIONLCALL=en_US.UTF-8"
e = create_engine(url)
r = e.execute("select 42 from dual").fetchall()

Please also refer to `sqlalchemy exasol documentation <https://exasol.github.io/sqlalchemy-exasol/master/user_guide.html#user-guide>`_.

JupySQL
-------

How to work with JupySQL in JupyterLab is described in :doc:`environments`.

Pandas
------

Importing Data into Pandas
^^^^^^^^^^^^^^^^^^^^^^^^^^

You can fetch data from Exasol into a Pandas DataFrame using pyexasol.

.. code-block:: python

import pandas as pd

# Execute a query and fetch data into a Pandas DataFrame, Conn is an existing pyexasol connection.
df = conn.export_to_pandas('SELECT * FROM <your_table_name>')

# Display the DataFrame
print(df)

Exporting Data from Pandas to Exasol
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can also export data from a Pandas DataFrame to an Exasol table.

.. code-block:: python

# Assume you have a Pandas DataFrame `df` you wish to export
conn.import_from_pandas(df, '<your_target_table_name>')

Ibis
----

SQLAlchemy
----------
Please refer to the `IBIS documentation <https://ibis-project.org/backends/exasol>`_.


Loading