commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r7278 - in trunk/gnue-common/src/datasources/drivers: DBSIG2 adod


From: reinhard
Subject: [gnue] r7278 - in trunk/gnue-common/src/datasources/drivers: DBSIG2 adodbapi/adodbapi interbase/interbase mysql/mysql oracle/Base postgresql/Base sapdb/sapdb sqlite/sqlite
Date: Tue, 29 Mar 2005 13:39:34 -0600 (CST)

Author: reinhard
Date: 2005-03-29 13:39:32 -0600 (Tue, 29 Mar 2005)
New Revision: 7278

Modified:
   trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
   trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
   trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py
   trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py
   trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
Log:
More logical defaults for DBSIG2 driver parameters.


Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-03-29 19:39:32 UTC (rev 7278)
@@ -48,27 +48,28 @@
   @cvar _driver: The loaded Python module of the DBSIG2 driver. Must be
     overwritten by descendants.
   @cvar _boolean_false: Value to post to the database for boolean FALSE
-    (defaults to '0'). Can be overwritten by descendants.
+    (defaults to False). Can be overwritten by descendants.
   @cvar _boolean_true: Value to post to the database for boolean TRUE
-    (defaults to '1'). Can be overwritten by descendants.
+    (defaults to True). Can be overwritten by descendants.
+  @cvar _numbers_as_string: Flags wether to convert numbers to strings or not.
+    Can be overwritten by descendants.
   @cvar _broken_fetchmany: Can be set to True by descendants if the DBSIG2
     module raises an exception if fetchmany() is called when no records are
     left.
   @cvar _broken_rowcount: Can be set to True by descendants if the DBSIG2
     module does not return a correct value for cursor.rowcount.
-  @cvar _numbers_as_string: Flags wether to convert numbers to strings or not.
-    Can be overwritten by descendants.
   @cvar _named_as_sequence: If paramstyle = 'named' pass parameters as
     sequence (True) or as mapping (False). Can be overwritten by descendants.
   """
 
   _driver = None                        # DBSIG2 compatible driver module
-  _boolean_false = '0'                  # value to pass for boolean FALSE
-  _boolean_true  = '1'                  # value to pass for boolean TRUE
+  _boolean_false = False                # value to pass for boolean FALSE
+  _boolean_true  = True                 # value to pass for boolean TRUE
+  _numbers_as_string = False            # Convert numbers into strings
+
   _broken_fetchmany = False             # Does fetchmany () raise an exception
                                         # when no records are left?
   _broken_rowcount = False              # Is cursor.rowcount unusable?
-  _numbers_as_string = True             # Convert numbers into strings
   _named_as_sequence = False            # Pass 'named' parameters as sequence
 
 

Modified: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py   
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py   
2005-03-29 19:39:32 UTC (rev 7278)
@@ -52,6 +52,12 @@
 
   _driver = adodbapi
 
+  # FIXME: These 3 values were the default before. Check if the new default
+  # would work, too, and if yes, remove the lines.
+  _boolean_false = '0'
+  _boolean_true  = '1'
+  _numbers_as_string = True
+
   _broken_rowcount = True
 
   defaultBehavior = Introspection

Modified: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py 
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py 
2005-03-29 19:39:32 UTC (rev 7278)
@@ -47,9 +47,11 @@
   """
 
   _driver            = kinterbasdb
+
+  # TODO: check if it would work with default (True/False), too
   _boolean_true      = 1
   _boolean_false     = 0
-  _numbers_as_string = False
+
   _broken_rowcount   = True
 
   defaultBehavior    = Introspection

Modified: trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py 
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py 
2005-03-29 19:39:32 UTC (rev 7278)
@@ -49,6 +49,10 @@
 
   _driver = MySQLdb
 
+  # TODO: Test with defaults (True/False)
+  _boolean_false = 0
+  _boolean_true  = 1
+
   defaultBehavior = Introspection
   defaultCreator  = Creation
 

Modified: trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py 
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py 
2005-03-29 19:39:32 UTC (rev 7278)
@@ -36,9 +36,13 @@
 
 class Connection (DBSIG2.Connection):
   """
-  Generic Connection class for PostgreSQL databases.
+  Generic Connection class for Oracle databases.
   """
 
+  # TODO: Test if it would work with the default (True/False), too
+  _boolean_false = 0
+  _boolean_true  = 1
+
   defaultBehavior = Introspection
 
   supportedDataObjects = {'object': DataObject.DataObject_Object,

Modified: 
trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py     
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py     
2005-03-29 19:39:32 UTC (rev 7278)
@@ -39,6 +39,12 @@
   Generic Connection class for PostgreSQL databases.
   """
 
+  import sys
+  if sys.hexversion < 0x02020000:
+    # For Python 2.1, True and False are 1 and 0, but Postres only likes '1'
+    # and '0' for boolean columns.
+    _numbers_as_string = True
+
   defaultBehavior = Introspection
   defaultCreator  = Creation
 

Modified: trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py 
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py 
2005-03-29 19:39:32 UTC (rev 7278)
@@ -47,9 +47,7 @@
   """
 
   _driver            = sapdb.dbapi
-  _boolean_false     = False
-  _boolean_true      = True
-  _numbers_as_string = False
+
   _named_as_sequence = True
 
   defaultBehavior    = Introspection

Modified: trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2005-03-29 19:00:02 UTC (rev 7277)
+++ trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2005-03-29 19:39:32 UTC (rev 7278)
@@ -58,9 +58,10 @@
 class Connection (DBSIG2.Connection):
 
   _driver            = sqlite
+
+  # TODO: test if the new default (True/False) would work, too
   _boolean_true      = 1
   _boolean_false     = 0
-  _numbers_as_string = False
 
   defaultBehavior = Introspection
   defaultCreator  = Creation





reply via email to

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