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

problems connecting to Oracle #209

Closed
eloyfelix opened this issue Dec 23, 2021 · 2 comments
Closed

problems connecting to Oracle #209

eloyfelix opened this issue Dec 23, 2021 · 2 comments

Comments

@eloyfelix
Copy link

eloyfelix commented Dec 23, 2021

Hi, first of all thanks for this great package.

I've used it a bit with polars and PostgreSQL and looks amazing.

I would like to use it now with Oracle but I can't really stablish a connection to my instance (DBA managed). I'd like to offer a bit more of information but I'm completely new to Rust.

When I try to connect like:

conn_str = f"oracle://{username}:{password}@{host}:{port}/{service_name}"
pl_df = cx.read_sql(conn=conn_str, 
                    query=sql,
                    return_type="arrow")

I get:
[2021-12-23T15:33:18Z ERROR r2d2] OCI Error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

conn_str syntax neither works for me in SQLAlchemy since I need to establish a connection using the Service Name, not using a SID. To connect to it with SQLAlchemy:

conn_str = f"oracle://{username}:{password}@{host}:{port}/?service_name={service_name}"

I think this might be somehow related.

I installed Rust and tried to explore a bit the issue but it is a lot to learn. I managed to connect to the same instance using the 2 underlying libraries connector-x uses (rust-oracle and r2d2-oracle) so I guess there might be something related to connector-x or its python interface.

use r2d2_oracle::oracle::Connection as oracle_conn;
oracle_conn::connect(username, password, "//examplehost.com:1561/servicename")

I'll try to give more information, possibly in the new year but I hope this is not as extremely confusing as I feel it is :P

edit: using version 0.2.3

@wangxiaoying
Copy link
Contributor

wangxiaoying commented Dec 24, 2021

Hi @eloyfelix , thanks for reporting this issue with the detailed information! I think it might be due to the oracle port since currently we didn't include the port in the connection and you are not using the default value here. I will fix this issue and make an alpha release: 0.2.4-alpha.2. Will let you know when it's done.

@eloyfelix Update: 0.2.4-alpha.2 is released. Please feel free to try out.

@eloyfelix
Copy link
Author

oh! I should have spotted that (I took a quick look at the code). It was indeed the missing port config.
0.2.4-alpha.2 tested and working! :) many thanks for the quick fix.

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

No branches or pull requests

2 participants