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

Add support for timedelta interval types #45

Open sandan opened 8 years ago

sandan commented 8 years ago

Currently the DBAPI supports teradata.datatypes.Interval as the underlying python object for teradata INTERVAL types. Python has a native object from the datetime package called datetime.timedelta that can be used.

escheie commented 8 years ago

The teradata.datatypes.Interval class provides a timedelta function to get the interval in it's datetime.timedelta represtation. As not all Intervals can be represented as a timedelta object (e.g. Year/Month), a custom object was created to represent all possible interval types. Does this function provide the functionality you're after?

Thanks, -Eric