From 8ca28c23f5f90818e58f5e11c7af860072dffc38 Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Wed, 18 Jun 2025 18:52:12 +0200 Subject: [PATCH 1/2] Add documentation for ODBC connections. --- docs/environment.yml | 2 ++ docs/source/ODBC.rst | 64 ++++++++++++++++++++++++++++++++++++++++++-- docs/source/conf.py | 2 +- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/docs/environment.yml b/docs/environment.yml index ab60e48..9386069 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -6,3 +6,5 @@ channels: dependencies: - breathe - sphinx_rtd_theme + - pip: + - sphinx-tabs diff --git a/docs/source/ODBC.rst b/docs/source/ODBC.rst index c453de3..a667442 100644 --- a/docs/source/ODBC.rst +++ b/docs/source/ODBC.rst @@ -1,4 +1,4 @@ -.. Copyright (c) 2020, Mariana Meireles +.. Copyright (c) 2025, Chiara Marmo Distributed under the terms of the BSD 3-Clause License. @@ -7,4 +7,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! :) \ No newline at end of file +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 `_ installed + + .. code-block:: bash + + %LOAD odbc DRIVER=;DBQ=:/;UID=;PWD= + + .. group-tab:: Oracle + + Once the `Oracle driver `_ installed + + .. code-block:: bash + + %LOAD odbc DRIVER=;DBQ=:/;UID=;PWD= + + Oracle does not distribute debian based packages but the driver can be installed on any Linux distribution via the + `available zip archives `_. + +.. _documentation: http://soci.sourceforge.net/doc/release/4.0/backends/odbc/ diff --git a/docs/source/conf.py b/docs/source/conf.py index eb38f3d..7dfef9b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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' From 0f4d4139c6565195e7afa822e1f4a50d44c29bbf Mon Sep 17 00:00:00 2001 From: Chiara Marmo Date: Wed, 18 Jun 2025 18:55:50 +0200 Subject: [PATCH 2/2] Fix syntax and Copyright --- docs/source/ODBC.rst | 3 ++- docs/source/conf.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/ODBC.rst b/docs/source/ODBC.rst index a667442..577abe5 100644 --- a/docs/source/ODBC.rst +++ b/docs/source/ODBC.rst @@ -1,4 +1,5 @@ -.. Copyright (c) 2025, Chiara Marmo +.. Copyright (c) 2020, Mariana Meireles + 2025, Chiara Marmo Distributed under the terms of the BSD 3-Clause License. diff --git a/docs/source/conf.py b/docs/source/conf.py index 7dfef9b..e9fd150 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ def setup(app): app.add_css_file("main_stylesheet.css") -extensions = ['breathe', 'sphinx_rtd_theme', "sphinx_tabs.tabs"] +extensions = ['breathe', 'sphinx_rtd_theme', 'sphinx_tabs.tabs'] breathe_projects = { 'xeus-sql': '../xml' } templates_path = ['_templates'] source_suffix = '.rst'