Skip to content

Commit 4200b49

Browse files
authored
Add documentation for ODBC connections (#91)
* Add documentation for ODBC connections. * Fix syntax and Copyright
1 parent a9c9508 commit 4200b49

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

docs/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ channels:
66
dependencies:
77
- breathe
88
- sphinx_rtd_theme
9+
- pip:
10+
- sphinx-tabs

docs/source/ODBC.rst

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. Copyright (c) 2020, Mariana Meireles
2+
2025, Chiara Marmo
23
34
Distributed under the terms of the BSD 3-Clause License.
45
@@ -7,4 +8,64 @@
78
ODBC
89
====
910

10-
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! :)
11+
Linux
12+
-----
13+
14+
Installation
15+
************
16+
17+
For now `soci-odbc` is not available from ``conda-forge``.
18+
The package is available under different names depending on your Linux distribution.
19+
20+
For example:
21+
22+
.. tabs::
23+
24+
.. group-tab:: Fedora 64bit
25+
26+
.. code-block:: bash
27+
28+
sudo dnf install libaio.x86_64 soci.x86_64 soci-odbc.x86_64
29+
30+
.. group-tab:: Ubuntu 64bit
31+
32+
.. code-block:: bash
33+
34+
sudo apt-get install libaio-dev libsoci-core4.0 libsoci-odbc4.0
35+
36+
Then from conda
37+
38+
.. code::
39+
40+
conda install xeus-sql jupyterlab -c conda-forge
41+
42+
Usage
43+
*****
44+
45+
To use the ODBC driver from inside a notebook you need to connect to the compatible database with the
46+
```LOAD``` magic and the related driver.
47+
48+
For example:
49+
50+
.. tabs::
51+
52+
.. group-tab:: PostGreSQL (to be tested)
53+
54+
Once the `PostGreSQL driver <https://odbc.postgresql.org/>`_ installed
55+
56+
.. code-block:: bash
57+
58+
%LOAD odbc DRIVER=<path to the pgsql driver>;DBQ=<hostname>:<port>/<database>;UID=<user>;PWD=<password>
59+
60+
.. group-tab:: Oracle
61+
62+
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
63+
64+
.. code-block:: bash
65+
66+
%LOAD odbc DRIVER=<path to the oracle driver>;DBQ=<hostname>:<port>/<SID>;UID=<user>;PWD=<password>
67+
68+
Oracle does not distribute debian based packages but the driver can be installed on any Linux distribution via the
69+
`available zip archives <https://www.oracle.com/europe/database/technologies/instant-client/linux-x86-64-downloads.html>`_.
70+
71+
.. _documentation: http://soci.sourceforge.net/doc/release/4.0/backends/odbc/

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def setup(app):
2323
app.add_css_file("main_stylesheet.css")
2424

25-
extensions = ['breathe', 'sphinx_rtd_theme']
25+
extensions = ['breathe', 'sphinx_rtd_theme', 'sphinx_tabs.tabs']
2626
breathe_projects = { 'xeus-sql': '../xml' }
2727
templates_path = ['_templates']
2828
source_suffix = '.rst'

0 commit comments

Comments
 (0)