Author: phd
Date: 2005-10-11 10:31:08 +0000 (Tue, 11 Oct 2005)
New Revision: 1100
Modified:
home/phd/SQLObject/paramstyles/sqlobject/firebird/firebirdconnection.py
home/phd/SQLObject/paramstyles/sqlobject/maxdb/maxdbconnection.py
home/phd/SQLObject/paramstyles/sqlobject/mssql/mssqlconnection.py
home/phd/SQLObject/paramstyles/sqlobject/postgres/pgconnection.py
home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py
home/phd/SQLObject/paramstyles/sqlobject/sybase/sybaseconnection.py
Log:
Chnaged c.execute(q) to DBAPI._executeRetry(self, conn, c, q)
to use our brand new SQLQuery.
Modified: home/phd/SQLObject/paramstyles/sqlobject/firebird/firebirdconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/firebird/firebirdconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/firebird/firebirdconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -101,7 +101,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
self.printDebug(conn, q, 'QueryIns')
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
if self.debugOutput:
self.printDebug(conn, id, 'QueryIns', 'result')
return id
Modified: home/phd/SQLObject/paramstyles/sqlobject/maxdb/maxdbconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/maxdb/maxdbconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/maxdb/maxdbconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -130,7 +130,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
self.printDebug(conn, q, 'QueryIns')
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
if self.debugOutput:
self.printDebug(conn, id, 'QueryIns', 'result')
return id
Modified: home/phd/SQLObject/paramstyles/sqlobject/mssql/mssqlconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/mssql/mssqlconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/mssql/mssqlconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -67,12 +67,12 @@
ON obj.id = col.id
WHERE obj.name = '%s'
and col.autoval is not null
-
+
"""
def _hasIdentity(self, conn, table):
query = self.HAS_IDENTITY % table
c = conn.cursor()
- c.execute(query)
+ DBAPI._executeRetry(self, conn, c, query)
r = c.fetchone()
return r is not None
@@ -95,7 +95,7 @@
del values[i]
except ValueError:
pass
-
+
if has_identity:
if id is not None:
c.execute('SET IDENTITY_INSERT %s ON' % table)
@@ -105,7 +105,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
print 'QueryIns: %s' % q
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
if has_identity:
c.execute('SET IDENTITY_INSERT %s OFF' % table)
@@ -155,11 +155,11 @@
column.dbName))
SHOW_COLUMNS = """
- select
- name,
- length,
- ( select name
- from systypes
+ select
+ name,
+ length,
+ ( select name
+ from systypes
where cast(xusertype as int)= cast(sc.xtype as int)
) datatype,
isnullable,
@@ -169,13 +169,13 @@
from syscolumns sc
LEFT OUTER JOIN syscomments m on sc.cdefault = m.id
AND m.colid = 1
- where
- sc.id in (select id
- from sysobjects
+ where
+ sc.id in (select id
+ from sysobjects
where name = '%s')
order by
colorder"""
-
+
def columnsFromSchema(self, tableName, soClass):
colData = self.queryAll(self.SHOW_COLUMNS
% tableName)
@@ -188,7 +188,7 @@
kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['notNone'] = not nullAllowed
if (defaultText):
- # Strip ( and )
+ # Strip ( and )
defaultText = defaultText[1:-1]
if defaultText[0] == "'":
defaultText = defaultText[1:-1]
@@ -212,7 +212,7 @@
if auto == 0:
option = "OFF"
c = conn.cursor()
- c.execute("SET AUTOCOMMIT "+option)
+ c.execute("SET AUTOCOMMIT " + option)
conn.setconnectoption(SQL.AUTOCOMMIT, option)
def guessClass(self, t, size):
Modified: home/phd/SQLObject/paramstyles/sqlobject/postgres/pgconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/postgres/pgconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/postgres/pgconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -123,7 +123,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
self.printDebug(conn, q, 'QueryIns')
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
if self.debugOutput:
self.printDebug(conn, id, 'QueryIns', 'result')
return id
Modified: home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -89,7 +89,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
self.printDebug(conn, q, 'QueryIns')
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
# lastrowid is a DB-API extension from "PEP 0249":
if id is None:
id = int(c.lastrowid)
Modified: home/phd/SQLObject/paramstyles/sqlobject/sybase/sybaseconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/sybase/sybaseconnection.py 2005-10-11 10:29:42 UTC (rev 1099)
+++ home/phd/SQLObject/paramstyles/sqlobject/sybase/sybaseconnection.py 2005-10-11 10:31:08 UTC (rev 1100)
@@ -63,7 +63,7 @@
def _hasIdentity(self, conn, table):
query = self.HAS_IDENTITY % table
c = conn.cursor()
- c.execute(query)
+ DBAPI._executeRetry(self, conn, c, query)
r = c.fetchone()
return r is not None
@@ -85,7 +85,7 @@
q = self._insertSQL(table, names, values)
if self.debug:
print 'QueryIns: %s' % q
- c.execute(q)
+ DBAPI._executeRetry(self, conn, c, q)
if has_identity:
c.execute('SET IDENTITY_INSERT %s OFF' % table)
if id is None:
|