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

Error connecting to python-oracledb #215

Open
centeiol opened this issue Oct 21, 2022 · 1 comment
Open

Error connecting to python-oracledb #215

centeiol opened this issue Oct 21, 2022 · 1 comment

Comments

@centeiol
Copy link

Hello ,

I opened a Issue at sqlalchemy regarding a connection to oracle wiyh new driver oracle+oracledb, and they tell me that this issue was related to ipython-sql.

The trhread
sqlalchemy/sqlalchemy#8676 (reply in thread)

Code

import oracledb
import pandas as pd
import sqlalchemy

%reload_ext sql
#%sql oracle+oracledb://user:[email protected]:1521/?service_name=XPTO.domain.net

sqlalchemy.version

Error

init() got an unexpected keyword argument 'bind'
Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys([])
'2.0.0b1'

Please coul you help

Regards

@ellipticview
Copy link

Until sqlalchemy supports python-oracledb, a workaround is documented here:
https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_c.html#python-frameworks-sql-generators-and-orms.

So you can use python-oracledb like this, which is very useful for running on MacOS M1 as no Oracle instant client is required:

import sys
import oracledb
oracledb.version = "8.3.0"
sys.modules["cx_Oracle"] = oracledb
import cx_Oracle

%load_ext sql

%sql oracle+cx_oracle://scott:[email protected]:1521/?service_name=ABC

pmfischer pushed a commit to pmfischer/ipython-sql that referenced this issue Sep 8, 2023
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