]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Oracle 'DATE' now does not perform any result processing,
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Mar 2010 15:27:18 +0000 (10:27 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Mar 2010 15:27:18 +0000 (10:27 -0500)
as the DATE type in Oracle stores full date+time objects,
that's what you'll get.  Note that the generic types.Date
type *will* still call value.date() on incoming values,
however.  When reflecting a table, the reflected type
will be 'DATE'.

CHANGES
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
test/dialect/test_oracle.py

diff --git a/CHANGES b/CHANGES
index f49c61392005fb3e691a9ff8a67c5c9147436b89..a7457e6d3199f7bb1d7b8a77e4381c8f4fbd141b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -289,6 +289,12 @@ CHANGES
    - "out" parameters require a type that is supported by
      cx_oracle.  An error will be raised if no cx_oracle
      type can be found.
+   - Oracle 'DATE' now does not perform any result processing,
+     as the DATE type in Oracle stores full date+time objects,
+     that's what you'll get.  Note that the generic types.Date
+     type *will* still call value.date() on incoming values, 
+     however.  When reflecting a table, the reflected type
+     will be 'DATE'.
      
 - sqlite
    - Added "native_datetime=True" flag to create_engine().
index 5f7a3029292ad08804bc00ac4c5d045c5a71a3c0..3107c8b6c9b523f072b19643bcd4b1bf351b69ac 100644 (file)
@@ -211,7 +211,6 @@ ischema_names = {
     'NVARCHAR2' : NVARCHAR,
     'CHAR' : CHAR,
     'DATE' : DATE,
-    'DATETIME' : DATETIME,
     'NUMBER' : NUMBER,
     'BLOB' : BLOB,
     'BFILE' : BFILE,
index 47909f8d177e0ca77f9aeb858c16506c9e649d2a..d536188da71b514f341fb015ebe2d1c708e8e986 100644 (file)
@@ -177,7 +177,8 @@ class _OracleRaw(oracle.RAW):
     pass
 
 colspecs = {
-    sqltypes.Date : _OracleDate,
+    sqltypes.Date : _OracleDate, # generic type, assume datetime.date is desired
+    oracle.DATE: oracle.DATE,  # non generic type - passthru
     sqltypes.LargeBinary : _OracleBinary,
     sqltypes.Boolean : oracle._OracleBoolean,
     sqltypes.Interval : _OracleInterval,
index a6c3c19bcd3e069f391ce57932f33979c39ceadc..fc698f28ac68505ebddf183ed742d4f805f58eb9 100644 (file)
@@ -460,6 +460,7 @@ class TypesTest(TestBase, AssertsCompiledSQL):
             (oracle.OracleRaw(), cx_oracle._OracleRaw),
             (String(), String),
             (VARCHAR(), VARCHAR),
+            (DATE(), DATE),
             (String(50), String),
             (Unicode(), Unicode),
             (Text(), cx_oracle._OracleText),