sfu-db / connector-x

Fastest library to load data from DB to DataFrames in Rust and Python
https://sfu-db.github.io/connector-x
MIT License
2.02k stars 163 forks source link

feat: Added Option for Oracle Connector to use Alias w/ Params #700

Closed pangjunrong closed 3 weeks ago

pangjunrong commented 1 month ago

The use of aliases defined in tnsnames.ora is a common connection method found in Oracle, which also enables the specification of communication protocols like TCP/TCPS (i.e. SSL-enabled) among other configurations through a DSN connection string.

This change adds parameter handling for the connection string defined for an Oracle DB connection. Specifically, the alias boolean parameter when set to true, parses the alias defined in the host directly to the oracle::Connector::new method to initialize the connector object.

For a connection using aliases, the connection string will look as such: oracle://<username>:<password>@<alias>?alias=true compared to the direct connection string method specifying host & port: oracle://<username>:<password>@<host>:<port>/<database>

This will resolve issues #202, #420 & #484 — it is a requested feature for DSN connection strings in TNS aliases to be used.

pangjunrong commented 1 month ago

Hey @wangxiaoying if this change is good to go, any chance we can get a minor release onto pypi? It'll be really helpful to get the MSSQL SSL support & Oracle alias connection in for downstream users to test it out 😄

wangxiaoying commented 3 weeks ago

Thank you @pangjunrong for the PR! It looks good to me. I will try to release a minor version for the new features this week.

wangxiaoying commented 3 weeks ago

Hi @pangjunrong , I just released an alpha version for the new features. You can install by pip install connectorx==0.3.4a3. Please feel free to give it a try!