PgDB: add possibility to provide query parameters on doSelect()
This commit is contained in:
parent
198d6021b4
commit
8dbb067996
1 changed files with 12 additions and 9 deletions
5
PgDB.py
5
PgDB.py
|
@ -70,10 +70,13 @@ class PgDB(object):
|
|||
self.con.rollback()
|
||||
return False
|
||||
|
||||
def doSelect(self,sql):
|
||||
def doSelect(self,sql,params):
|
||||
cursor = self.con.cursor()
|
||||
try:
|
||||
if params is None:
|
||||
cursor.execute(sql)
|
||||
else:
|
||||
cursor.execute(sql,params)
|
||||
results = cursor.fetchall()
|
||||
return results
|
||||
except Exception:
|
||||
|
|
Loading…
Reference in a new issue