Skip to content
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

[FEATURE] PyODBC documentation / driver support for sqlalchemy for python projects #3198

Open
justmike1 opened this issue Dec 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@justmike1
Copy link

Is your feature request related to a problem?
I want to use the odbc plugin of opensearch but either it is not possible in python projects or the documentation are not concise when it comes to it because all I see are PowerBI or Tableau or OS installation docs.

What solution would you like?
I want a simple PyODBC connection string, same as how JDBC works...

What alternatives have you considered?
I have tried elasticsearch-dbapi but it isn't maintainable.
Nothing maintainable exists.

Do you have any additional context?
None.

@justmike1 justmike1 added enhancement New feature or request untriaged labels Dec 8, 2024
@Swiddis
Copy link
Collaborator

Swiddis commented Dec 17, 2024

When I was last messing with this, the issue was that while the Python ecosystem predominantly uses unixODBC for ODBC connections, our ODBC driver uses iODBC. I don't think they're generally interchangeable, so it'd take some refactoring work to change our system to use unixODBC. I vaguely recall some issues on the Python side regarding iODBC support, e.g. mkleehammer/pyodbc#681, but I'm not sure it's an easy fix for them either and unixODBC is more widely used, so this might be a thorn for a while.

More info on the differences at What are the functional differences between iODBC and unixODBC? (stackexchange)

@Swiddis
Copy link
Collaborator

Swiddis commented Dec 17, 2024

For what it's worth I tried digging up some old test code for the SQL ODBC driver with PyODBC, I verified the driver is installed correctly (and works via iODBC) but it doesn't seem to be usable via unixODBC.

import pyodbc # 5.2.0

assert "OpenSearch SQL" in pyodbc.drivers()
pyodbc.connect("Driver={OpenSearch SQL};DSN=OS-Localhost", encoding="utf-8")
$ python3 connect.py
Traceback (most recent call last):
  File "/Users/sawiddis/code/temp/odbc-tester/connect.py", line 4, in <module>
    pyodbc.connect("Driver={OpenSearch SQL};DSN=OS-Localhost", encoding="utf-8")
pyodbc.InterfaceError: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found and no default driver specified (0) (SQLDriverConnect)')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants