summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-18 03:00:05 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-18 03:00:05 +0000
commit9680e6483f4a811e147dd75bf3f5ccab989f01e0 (patch)
tree55d13b9a50e139561b127cde18e57fc85fb3db82 /lib/sqlalchemy/dialects/postgresql
parente9076d04b0ec82a403a885be7999eab7d346923b (diff)
downloadsqlalchemy-9680e6483f4a811e147dd75bf3f5ccab989f01e0.tar.gz
- 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
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py4
1 files changed, 4 insertions, 0 deletions
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