Skip to content
Draft
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: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ updates:
- "*"
exclude-patterns:
- "sqlalchemy"
- "turbodbc"

13 changes: 8 additions & 5 deletions .github/workflows/slow-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
contents: read

tests:
name: Integration-Tests (${{matrix.connector}}, Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
name: Integration-Tests (Python-${{ matrix.python-version }}, test:${{ matrix.integration-group }}, Exasol-${{ matrix.exasol-version}}, ${{matrix.connector}})
needs: [ build-matrix ]
runs-on: ubuntu-24.04
permissions:
Expand All @@ -31,17 +31,20 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install via apt
run: sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev
- name: Start test db
run: poetry run -- nox -s db:start -- --db-version ${{ matrix.exasol-version }}

- name: Run Tests and Collect Coverage
run: |
export SQLALCHEMY_WARN_20=1
poetry run -- nox -s test:integration -- --coverage --db-version ${{ matrix.exasol-version }}
poetry run -- nox -s test:${{ matrix.integration-group }}

- name: Upload Artifacts
uses: actions/upload-artifact@v5
with:
name: coverage-python${{ matrix.python-version }}-${{matrix.connector}}-exasol${{ matrix.exasol-version }}slow
name: coverage-python${{ matrix.python-version }}-${{ matrix.integration-group }}-exasol${{ matrix.exasol-version }}-${{matrix.connector}}-slow
path: .coverage
include-hidden-files: true

- name: Stop test db
run: poetry run -- nox -s db:stop
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.lint*
.test-results.db
.html-documentation
odbcconfig/odbcinst.ini

_build/

Expand Down
22 changes: 2 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,15 @@ SQLAlchemy Dialect for EXASOL DB
:target: https://pypi.org/project/sqlalchemy_exasol
:alt: PyPI - Downloads


Getting Started with SQLAlchemy-Exasol
--------------------------------------
SQLAlchemy-Exasol supports multiple dialects, primarily differentiated by whether they are ODBC or Websocket-based.

Choosing a Dialect
++++++++++++++++++

We recommend using the Websocket-based dialect due to its simplicity.
ODBC-based dialects demand a thorough understanding of (Unix)ODBC, and the setup is considerably more complex.

.. warning::

The maintenance of Turbodbc & pyodbc support is currently paused, and it is planned to be phased out in future versions.

SQLAlchemy-Exasol supports a Websocket-based dialect.

System Requirements
-------------------
- Exasol >= 7.1 (e.g. `docker-db <test_docker_image_>`_ or a `cloud instance <test_drive_>`_)
- Exasol >= 7.1 (e.g. `docker-db <test_docker_image_>`_ or a `Exasol SaaS instance <test_drive_>`_)
- Python >= 3.10

.. note::

For ODBC-Based Dialects, additional libraries required for ODBC are necessary
(for further details, checkout the `developer guide`_).

Features
--------

Expand All @@ -80,5 +63,4 @@ Check out sqlalchemy-exasols's [User Guide(https://exasol.github.io/sqlalchemy-e

.. _developer guide: https://github.com/exasol/sqlalchemy-exasol/blob/master/doc/developer_guide/developer_guide.rst
.. _test_docker_image: https://github.com/exasol/docker-db
.. _odbc_driver: https://docs.exasol.com/db/latest/connect_exasol/drivers/odbc/odbc_linux.htm
.. _test_drive: https://cloud.exasol.com/signup
21 changes: 21 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# Unreleased

In this release, the ODBC-based dialects pyodbc and Turbodbc were dropped. Please
switch over to using the websocket dialect. Connection
strings should be altered to start with `exa+websocket://`.

## Refactoring

- #621: Added `future=true` to `create_engine` to use the 2.0 API
- #623: Started switch to `sqlalchemy` 2.x (CI tested with 2.0.43)
- All unit, `exasol`, and `regression` tests are working
- Several tests from `sqlalchemy` are failing, have been marked as skipped, and require investigation
- Reinstated the ArgSignatureTest which ensures that all visit_XYZ() in `_sql.Compiler` subclasses have `**kw`
- #626: Reinstated `sqlalchemy` tests:
- `TrueDivTest.test_floordiv_integer` and `TrueDivTest.test_floordiv_integer_bound` by providing an override in `EXACompiler.visit_floordiv_binary`
- `TrueDivTest.test_truediv_numeric` by providing `ExaDecimal` to the `EXADialect_pyodbc.colspecs` list
- a few tests from `ComponentReflectionTest` as `define_reflected_tables` is overridden based on what Exasol supports
- #631: Updated `EXADialect.has_table` to search for both tables and views, fixed passing of schema=None to dialect methods, and reinstated `sqlalchemy` tests:
- `ReturningGuardsTest` are used to indicate that the Exasol dialect, which does not natively support the [RETURNING clause](https://docs.sqlalchemy.org/en/20/glossary.html#term-RETURNING), is set up per the API specifications
- `ComponentReflectionTest.test_not_existing_table` is used to indicate that specific `EXADialect` methods (i.e. `get_columns`) check to see if the requested table/view exists and if not, they will now toss a `NoSuchTableError` exception
- #403: Dropped support for Turbodbc
- #404: Dropped support for pyodbc
40 changes: 4 additions & 36 deletions doc/developer_guide/developer_guide.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Development
============
This chapter contains information helpful when you want to engage in development of this project.
``sqlalchemy-exasol`` provides an Exasol dialect for ``sqlalchemy``. For further information
on the creation of a dialect, see `SQLAlchemy's README.dialects.rst <https://github.com/sqlalchemy/sqlalchemy/blob/main/README.dialects.rst>`__.

Prerequisites
-------------
Expand All @@ -16,25 +18,9 @@ Tools
* Prerequisites_


Libraries
+++++++++
* unixodbc
* unixodbc-dev
* libboost-date-time-dev
* libboost-locale-dev
* libboost-system-dev


Example: Install of required system libraries on Ubuntu

.. code-block::

sudo apt-get install unixodbc unixodbc-dev libboost-date-time-dev libboost-locale-dev libboost-system-dev


Locale
+++++++
Make sure the local is setup appropriately.
Make sure the locale is set up appropriately.

Example: Setting up an english locale

Expand Down Expand Up @@ -123,28 +109,10 @@ Tests

.. code-block::

# make sure you are using the virtual environment poetry has setup for this project
# make sure you are using the virtual environment poetry has set up for this project
poetry shell


#. Run all tests with `pyodbc` connector

.. code-block::

nox

or

.. code-block::

nox -s "verify(connector='pyodbc')"

#. Run all tests with `turbodbc` connector

.. code-block::

nox -s "verify(connector='turbodbc')"

.. attention::

If something still is not working or unclear, you may want to look into the CI/CD action_ files.
Expand Down
5 changes: 2 additions & 3 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ Documentation of SQLAlchemy-Exasol
:link: faq
:link-type: ref

Frequently asked questsions.
Frequently asked questions.

.. toctree::
:maxdepth: 1
:hidden:

user_guide
user_guide/index
developer_guide/index
faq
changes/changelog

67 changes: 7 additions & 60 deletions doc/user_guide.rst → doc/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,20 @@ Getting Started
# sqlalchemy 2.x, be passed through `sqlalchemy.sql.text`.
result = con.execute(sql.text("select 42 from dual")).fetchall()

# engine.begin() is for DML & DDL, as we don't want to rely on autocommit
# For easier usage of transactions, you can use engine.begin() for DML & DDL,
# if you don't want to rely on autocommit. However, you can with
# `engine.connect()` commit as you go with `con.commit()` or use, for more
# complex scenarios:
# with engine.connect() as con:
# with conn.begin():
# ...
with engine.begin() as con:
...


.. warning::

To use an ODBC-based dialect, you must specify it as an extra during installation.
Maintenance for these ODBC-based dialects is paused, and it is planned to remove them
in future versions.

.. code-block:: shell

pip install "sqlalchemy-exasol[pydobc]"
pip install "sqlalchemy-exasol[turbodbc]"


Further Examples
~~~~~~~~~~~~~~~~

Websocket-based Dialect
------------------------

.. code-block:: python

from sqlalchemy import create_engine, sql
Expand Down Expand Up @@ -117,50 +108,6 @@ Websocket-based Dialect
...


.. note::
Validation with fingerprint is only supported in the Websocket-based dialect, and not
the ODBC-based dialects (Pyodbc, Turbodbc).


Pyodbc-based Dialect
---------------------

.. code-block:: python

from sqlalchemy import create_engine, sql

user = "sys"
password = "exasol"
host = "127.0.0.1"
port = "8563
schema = "my_schema

url = f"exa+pyodbc://{user}:{password}@{host}:{port}/{schema}?CONNECTIONLCALL=en_US.UTF-8&driver=EXAODBC"
engine = create_engine(url)
query = "select 42 from dual"
with engine.connect() as con:
result = con.execute(sql.text(query)).fetchall()


Turbo-based Dialect
---------------------

.. code-block:: python

from sqlalchemy import create_engine, sql

user = "sys"
password = "exasol"
host = "127.0.0.1"
port = "8563
schema = "my_schema

url = f"exa+turbodbc://{user}:{password}@{host}:{port}/{schema}?CONNECTIONLCALL=en_US.UTF-8&driver=EXAODBC"
engine = create_engine(url)
query = "select 42 from dual"
with engine.connect() as con:
result = con.execute(sql.text(query)).fetchall()

General Notes
~~~~~~~~~~~~~

Expand Down
Binary file removed driver/libexaodbc-uo2214lv2.so
Binary file not shown.
67 changes: 0 additions & 67 deletions exasol/odbc.py

This file was deleted.

2 changes: 1 addition & 1 deletion noxconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Config(BaseConfig):
environment_name: str = "test"
db_port: int = 8563
bucketfs_port: int = 2580
connectors: list[str] = ["pyodbc", "turbodbc", "websocket"]
connectors: list[str] = ["websocket"]
plugins: list = [StartDB, StopDB]


Expand Down
Loading