commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r6806 - in trunk/gnue-common/src/datasources/drivers/sqlite: Schema/Crea


From: johannes
Subject: r6806 - in trunk/gnue-common/src/datasources/drivers/sqlite: Schema/Creation sqlite
Date: Tue, 14 Dec 2004 13:44:27 -0600 (CST)

Author: johannes
Date: 2004-12-14 13:44:26 -0600 (Tue, 14 Dec 2004)
New Revision: 6806

Modified:
   trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/Creation.py
   trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
Log:
Use 'integer' for boolean types, so evaluation works better


Modified: 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/Creation.py
===================================================================
--- 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/Creation.py    
    2004-12-14 07:55:26 UTC (rev 6805)
+++ 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/Creation.py    
    2004-12-14 19:44:26 UTC (rev 6806)
@@ -258,12 +258,13 @@
 
   def boolean (self, fieldDefinition):
     """
-    This funciton returns the native data type for a boolean, which is
-    'boolean'
+    This function returns the native data type for a boolean. Since SQLite is
+    typeless by default we use an 'integer'. This is needed so a pysqlite
+    returns 0 or 1 for boolean values.
 
     @param fieldDefinition: dictionary describing the field
-    @return: 'boolean'
+    @return: 'integer'
     """
-    return "boolean"
+    return "integer"
 
 

Modified: trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2004-12-14 07:55:26 UTC (rev 6805)
+++ trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2004-12-14 19:44:26 UTC (rev 6806)
@@ -78,6 +78,9 @@
   _DatabaseError  = SIG2api.DatabaseError
   defaultBehavior = Introspection
   defaultCreator  = Creation
+  _boolean_true   = 1
+  _boolean_false  = 0
+  _numbers_as_string = False
 
   supportedDataObjects = {
     'object': DataObject_Object,
@@ -97,6 +100,7 @@
     self.noTransactions = False
 
 
+
   # ---------------------------------------------------------------------------
   # Connect to a given database according to the connectData dictionary
   # ---------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]