From 9680e6483f4a811e147dd75bf3f5ccab989f01e0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 18 Jan 2010 03:00:05 +0000 Subject: - added native INTERVAL type to the dialect. This supports only the DAY TO SECOND interval type so far due to lack of support in cx_oracle for YEAR TO MONTH. [ticket:1467] - The Interval type includes a "native" flag which controls if native INTERVAL types (postgresql + oracle) are selected if available, or not. "day_precision" and "second_precision" arguments are also added which propagate as appropriately to these native types. Related to [ticket:1467]. - DefaultDialect.type_descriptor moves back to being per-dialect. TypeEngine/TypeDecorator key type impls to the dialect class + server_version_info so that the colspecs dict can be modified per-dialect based on server version. - Fixed TypeDecorator's incorrect usage of _impl_dict --- lib/sqlalchemy/dialects/postgresql/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/dialects/postgresql') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 308e23bae..2c8f896e9 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -109,6 +109,10 @@ class INTERVAL(sqltypes.TypeEngine): def adapt(self, impltype): return impltype(self.precision) + @classmethod + def _adapt_from_generic_interval(cls, interval): + return INTERVAL(precision=interval.second_precision) + @property def _type_affinity(self): return sqltypes.Interval -- cgit v1.2.1