OpenInformix / IfxPy

Informix native Python driver for scalable enterprise and IoT solutions.
Other
46 stars 22 forks source link

Support for interval types #4

Closed cypres-it closed 6 years ago

cypres-it commented 6 years ago

Am I right that IFxPy currently does not support interval types?

msatyan commented 6 years ago

I am assuming that you are referring to sqlalchemy.types.Interval, if so we don’t have support yet. The SQLAlchemy support is a priority item in our list. By any chance if you are accessing Informix interval type value then you should be able to get it in as string.

cypres-it commented 6 years ago

I want to use the informix interval type:

https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqlr.doc/ids_sqr_123.htm

At the moment I have to convert the interval explicitly to/from a string.

If I do a "select * from ..." then the interval type column values will be NULL/None.

Ideally I would like the driver to automatically convert interval types from/to the Python type datetime.timedelta.

The second best thing would be if the driver would at least automatically convert the intervals in select result sets to a string instead of just dropping the values and returning None.

The current behaviour makes dealing with interval types really cumbersome especially when you are dealing with dynamic query generation and the like.

We want to migrate from the old "informixdb" driver to IfxPy. However informixdb handled these types transparently converting them automatically from/to timedelta values in Python.

msatyan commented 6 years ago

Thanks for the information, certainly we will consider it as feature request. As you know the driver source code is publically available you may too make the code change. By any chance if you make the code change please send us a pull request.

Marc176 commented 6 years ago

This is really needed - maybe you give it a high priority

msatyan commented 6 years ago

@cypres-it Thanks Very Much for the pull request, we will test an upload to PyPi, the it will be available with pip install.

jsagrera commented 6 years ago

@cypres-it 👍

jsagrera commented 6 years ago

Pull#7