new Interval type patch contribute

Issue #595 resolved
Former user created an issue

Here is a small patch to add support of storing timedelta valuesin SQL databases. If possible it tries to use native DB support of timedelta (just PostgreSQL for now), if there is no such it fallbacks to store timedeltas as sqltypes.DateTime with base of zero timestamp.

Comments (11)

  1. Mike Bayer repo owner

    attached is a revised patch which adds a template method to TypeDecorator such that the interval type need not duplicate the code within dialect_impl(). Also, the check for the PGDialect and the retrieval of the DateTime dialect implementation have been extracted into two methods since the latter is an expensive operation that is not needed within convert_bind_param() and convert_result_value().

    need to verify that this new patch functions correctly. Alternatively, provide a patch for test/sql/testtypes.py that adds unit test support for this new type.

  2. Former user Account Deleted
    • removed status
    • changed status to open

    Patch to revision 2746.

    IMPROVE: more clearer handle if Interval type will have native support in multiple engines FIX: now correctly work with orm, heavily tested.

  3. Log in to comment