Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

Make tdodbc driver independent #18

Open sandan opened 8 years ago

sandan commented 8 years ago

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.

escheie commented 8 years ago

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

sandan commented 8 years ago

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.

escheie commented 8 years ago

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

padhia commented 8 years ago

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.