Skip to content

Add documentation for ODBC connections #91

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ channels:
dependencies:
- breathe
- sphinx_rtd_theme
- pip:
- sphinx-tabs
63 changes: 62 additions & 1 deletion docs/source/ODBC.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. Copyright (c) 2020, Mariana Meireles
2025, Chiara Marmo

Distributed under the terms of the BSD 3-Clause License.

Expand All @@ -7,4 +8,64 @@
ODBC
====

We're missing this part of the docs. If you've used ``xeus-sql`` in this context and would like to help, please feel free to open a PR! :)
Linux
-----

Installation
************

For now `soci-odbc` is not available from ``conda-forge``.
The package is available under different names depending on your Linux distribution.

For example:

.. tabs::

.. group-tab:: Fedora 64bit

.. code-block:: bash

sudo dnf install libaio.x86_64 soci.x86_64 soci-odbc.x86_64

.. group-tab:: Ubuntu 64bit

.. code-block:: bash

sudo apt-get install libaio-dev libsoci-core4.0 libsoci-odbc4.0

Then from conda

.. code::

conda install xeus-sql jupyterlab -c conda-forge

Usage
*****

To use the ODBC driver from inside a notebook you need to connect to the compatible database with the
```LOAD``` magic and the related driver.

For example:

.. tabs::

.. group-tab:: PostGreSQL (to be tested)

Once the `PostGreSQL driver <https://odbc.postgresql.org/>`_ installed

.. code-block:: bash

%LOAD odbc DRIVER=<path to the pgsql driver>;DBQ=<hostname>:<port>/<database>;UID=<user>;PWD=<password>

.. group-tab:: Oracle

Once the `Oracle driver <https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-Oracle-from-RHEL-or-Centos#install-the-oracle-instant-client-odbc-driver-for-linux>`_ installed

.. code-block:: bash

%LOAD odbc DRIVER=<path to the oracle driver>;DBQ=<hostname>:<port>/<SID>;UID=<user>;PWD=<password>

Oracle does not distribute debian based packages but the driver can be installed on any Linux distribution via the
`available zip archives <https://www.oracle.com/europe/database/technologies/instant-client/linux-x86-64-downloads.html>`_.

.. _documentation: http://soci.sourceforge.net/doc/release/4.0/backends/odbc/
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def setup(app):
app.add_css_file("main_stylesheet.css")

extensions = ['breathe', 'sphinx_rtd_theme']
extensions = ['breathe', 'sphinx_rtd_theme', 'sphinx_tabs.tabs']
breathe_projects = { 'xeus-sql': '../xml' }
templates_path = ['_templates']
source_suffix = '.rst'
Expand Down