]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
oracle boolean type [ticket:257]
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Jul 2006 18:05:36 +0000 (18:05 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Jul 2006 18:05:36 +0000 (18:05 +0000)
CHANGES
lib/sqlalchemy/databases/oracle.py

diff --git a/CHANGES b/CHANGES
index 6a90e742423d2d52b4518c3743b93283270ddfda..c177757ab96f3acc50e31724e712dfc8e46e07a4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ primary key columns are null (i.e. when mapping to outer joins etc)
 - fixed reflection of foreign keys to autoload the referenced table
 if it was not loaded already
 - [ticket:256] - pass URL query string arguments to connect() function
+- [ticket:257] - oracle boolean type
 
 0.2.6
 - big overhaul to schema to allow truly composite primary and foreign
index 897ed640efe1ae204a476147fdceffbca86c2cd0..6ca81c6623e5c916d98206902840e6653739da14 100644 (file)
@@ -52,7 +52,21 @@ class OracleBinary(sqltypes.Binary):
         return "BLOB"
 class OracleBoolean(sqltypes.Boolean):
     def get_col_spec(self):
-        return "BOOLEAN"
+        return "SMALLINT"
+    def convert_result_value(self, value, dialect):
+        if value is None:
+            return None
+        return value and True or False
+    def convert_bind_param(self, value, dialect):
+        if value is True:
+            return 1
+        elif value is False:
+            return 0
+        elif value is None:
+            return None
+        else:
+            return value and True or False     
+
         
 colspecs = {
     sqltypes.Integer : OracleInteger,