[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common/src/dbdrivers _dbsig/DBdriver....
From: |
Jason Cater |
Subject: |
gnue/gnue-common/src/dbdrivers _dbsig/DBdriver.... |
Date: |
Mon, 23 Jul 2001 00:11:42 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Branch: gnuef-new-datasources
Changes by: Jason Cater <address@hidden> 01/07/23 00:11:42
Modified files:
gnue-common/src/dbdrivers/_dbsig: DBdriver.py
gnue-common/src/dbdrivers/postgresql: DBdriver.py
Log message:
added optimizations to record posting; brought cached records in line
with data just posted; fixed namespace issue w/internal cursors; misc other bug
fixes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.7.2.2&tr2=1.7.2.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py.diff?cvsroot=OldCVS&only_with_tag=gnuef-new-datasources&tr1=1.8.2.3&tr2=1.8.2.4&r1=text&r2=text
Patches:
Index: gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.6
gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.7
--- gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py:1.6 Tue Jun 5
18:22:55 2001
+++ gnue/gnue-common/src/dbdrivers/_dbsig/DBdriver.py Tue Jun 5 22:24:40 2001
@@ -146,11 +146,11 @@
# Used to convert a condition tree to an sql where clause
- def _conditionToSQL (condition):
+ def _conditionToSQL (self, condition):
if condition == {} or condition == None:
return ""
elif type(condition) == types.DictType:
- cond = GConditions.buildConditionFromDict(cond)
+ cond = GConditions.buildConditionFromDict(condition)
else:
cond = condition
@@ -162,10 +162,10 @@
_and = GConditions.GCand(cond)
_and._children = chillun
- return " WHERE (%s)" % (this.__conditionToSQL (cond._children[0]))
+ return " WHERE (%s)" % (self.__conditionToSQL (cond._children[0]))
# Used internally by _conditionToSQL
- def __conditionToSQL (element):
+ def __conditionToSQL (self, element):
if type(element) != types.InstanceType:
return "%s" % element
else:
@@ -178,7 +178,7 @@
return "'%s'" % element.getValue()
elif self.conditionElements.has_key(otype):
for i in range(0, len(element._children)):
- element._children[i] = __conditionToSQL(element._children[i])
+ element._children[i] = self.__conditionToSQL(element._children[i])
if len(element._children) < self.conditionElements[otype][0]:
raise GConditions.ConditionError, \
'Condition element "%s" expects at least %s arguments; found %s' %
\
Index: gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py
diff -u gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.8
gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.9
--- gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py:1.8 Wed Jul 4
17:24:11 2001
+++ gnue/gnue-common/src/dbdrivers/postgresql/DBdriver.py Thu Jul 12
20:56:31 2001
@@ -109,6 +109,7 @@
password=connectData['_password'],
host=connectData['host'],
database=connectData['dbname'])
+ self.triggerExtensions = TriggerExtensions(self._dataConnection)
except self._DatabaseError, value:
raise GDataObjects.ConnectionError, value
@@ -138,16 +139,44 @@
return DBSIG_DataObject_SQL._buildQuery(self, conditions)
+#
+# Extensions to Trigger Namespaces
+#
+class TriggerExtensions:
+
+ def __init__(self, connection):
+ self.__connection = connection
+
+ # Return the current date, according to database
+# def getDate(self):
+# pass
+
+ # Return a sequence number from sequence 'name'
+# def getSequence(self, name):
+# pass
+
+ # Run the SQL statement 'statement'
+# def sql(self, statement):
+# pass
+
+
+######################################
+#
+# The following hashes describe
+# this driver's characteristings.
+#
+######################################
+
+#
+# All datasouce "types" and corresponding DataObject class
+#
supportedDataObjects = {
'object': PG_DataObject_Object,
'sql': PG_DataObject_SQL
}
-
-
-
##########################################################################
##########################################################################
##
@@ -175,7 +204,8 @@
self.connection = pg.DB(dbname, host, -1, None, None, user, passwd)
if GConfig.get('Encoding') != 'DEFAULT':
self.connection.query("set encoding to '%s'" % GConfig.get('Encoding'))
-
+
+ self.triggerExtensions = TriggerExtensions(self.connection)
except pg.error, value:
raise GDataObjects.ConnectionError, value
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnue-common/src/dbdrivers _dbsig/DBdriver....,
Jason Cater <=