Hi There,So I have a bit of an (admittedly unusual) question:I understand that the Interval type is designed to operate usingdatetime.timedelta on those SQL engines that natively support theInterval data type (eg PostgreSQL).I also understand that when operating on SQL engines that do *not*natively support the Interval data type, SQLAlchemy coercesdatetime.timedelta values to datetime.datetime values relative to theepoch date.Is my understanding so far correct?
If so, here is the crux of the situation: given an ORM model classwith an Interval attribute, when introspecting either that model class(i.e. the class of the model itself) OR when introspecting an instanceof that model class (presumably navigating acrossInstrumentedAttributes and related Comparators) how can onedifferentiate between:A) an attribute that is still a native Interval type,B) a “converted” Interval (now represented as a DATETIME type), andC) a native DATETIME type that does not have any relationship to intervals
I’m almost certain there’s a mechanism to do this differentiation bynavigating the internals, but I'm having trouble putting my finger onhow best to accomplish this.
My overall objective is to use thisdifferentiation to do appropriate datetime / timedelta arithmetic andconversion based on whether the timedelta is to be persisted to the DBas a native Interval type, or as a datetime relative to the epochtime.Any help or guidance would be much appreciated!
All the best,ChrisSent from my iPhone
--SQLAlchemy -The Python SQL Toolkit and Object Relational MapperTo post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.---You received this message because you are subscribed to the Google Groups "sqlalchemy" group.To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/CACng_W8AwxAZp1ODeBBTsh%2B1v0hRcet%2Bw6cvdOmsfxwp8WRSLw%40mail.gmail.com.