PyTd icon indicating copy to clipboard operation
PyTd copied to clipboard

Make tdodbc driver independent

Open sandan opened this issue 9 years ago • 4 comments

Other projects might need a Teradata DBAPI implementation (for example, I'm implementing a sqlalchemy dialect for Teradata which relies on a DBAPI implementation). While this project implements the tdodbc module, it also comes with other features that may not be related or used in the projects that just need the DBAPI implementation.

Since this is already implemented in this project (tdodbc and its dependencies), it would be great to make the DBAPI implementation its own project so that other projects can use it.

sandan avatar Nov 20 '15 22:11 sandan

Hi Sandan,

The tdodbc module included in the Teradata Python Module package was developed as a standalone DBAPI implementation and can be used directly by other projects. Below is an example:

from teradata import tdodbc
conn = tdodbc.connect(DSN="MyDSN");

When using tdodbc directly, you bypass the DevOps enabled features like external configuration, variable substitution, query banding, and logging. Is this what you are looking for?

Thanks, -Eric

escheie avatar Nov 21 '15 22:11 escheie

Hey Eric, I apologize, I meant independent as in making tdodbc its own github project. I edited my original post to make it more clear. My concern is that as this project grows, the projects that need just the tdodbc module would have to install more than they need.

sandan avatar Nov 22 '15 01:11 sandan

Ah, got it. I understand your concern but you should know that it was intentional not to depend on any libraries outside of the python standard library to ensure that dependency conflicts were not introduced. Also, when anyone discusses extending functionality that is beyond the scope of providing a DevOps enabled API to Teradata UDA systems like adding an interactive SQL client, I encourage them to create a new project. Therefore, you can safely depend on the teradata module within other modules without worrying about introducing unwanted dependencies. I will leave this issue open though as a reminder of your concern.

Thanks, -Eric

escheie avatar Nov 22 '15 05:11 escheie

I second OP's request. Standalone tdodbc and tdrest as python DB API compliant modules have more appeal in certain situations. While DevOps is great, but unless it becomes part of standard Python API, its appeal will be limited. Many organizations prefer standard interfaces (such as Python DB API) that are platform neutral over something that has more features but is tied to one platform.

All major database vendors provide Python DB API modules. I could be wrong but I know of only this project that implements Python DB API for Teradata. (One can use pyodbc but it has a lot of limitations and bugs).

While it is possible to still use tdodbc by installing entire DevOps suite, not only it is unnecessary but will require unnecessary module upgrades (and related application regression testing that goes with it) each time an unrelated bug is fixed elsewhere in DevOps module.

padhia avatar Dec 08 '15 16:12 padhia