Oracle should use the native interval type for the sqlalchemy interval type in the same way postgresql does
As of cx_Oracle 5.0, the Oracle engine supports a native interval type and it should be used instead of a timestamp. Postgresql has support for this in sqlalchemy and it should be extended to Oracle. This will also help reflection as oracle interval types do not like being bound to timestamp types.
Comments (5)
-
Account Deleted -
repo owner - changed milestone to 0.6.0
this is targeted towards 0.6 and should probably be dynamically modified based on the detected version of cx_oracle, as well as the version of Oracle actually present (unless Oracle has it going back to 8)
-
Account Deleted If cx_Oracle version is >= 5.0 released 12/13/2008 then all supported versions of Oracle have a native interval type. Oracle versions < 9i circa 2001 do not have a native interval type.
Replying to zzzeek:
this is targeted towards 0.6 and should probably be dynamically modified based on the detected version of cx_oracle, as well as the version of Oracle actually present (unless Oracle has it going back to 8)
-
repo owner - changed status to resolved
seems like we can only get INTERVAL DAY TO SECOND going for now. YEAR TO MONTH seems fairly pointless and I couldn't get it to work with cx_oracle as of yet. 9680e6483f4a811e147dd75bf3f5ccab989f01e0
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
a couple of quick and dirty patches to get things going
sqlalchemy-0.5.4p2/lib/sqlalchemy/databases/oracle.py 146,149d145 < class OracleInterval(sqltypes.Interval): < def get_col_spec(self): < return "INTERVAL" < 294d289 < sqltypes.Interval : OracleInterval,
sqlalchemy-0.5.4p2/lib/sqlalchemy/types.py 823,825c823 < import sqlalchemy.databases.oracle as oracle < self.__supported = {pg.PGDialect:pg.PGInterval, oracle.OracleDialect:oracle.OracleInterval} < del oracle