PgDB: add possibility to provide query parameters on doSelect()
This commit is contained in:
parent
6e778a8691
commit
21bd45ad25
1 changed files with 2 additions and 2 deletions
|
@ -84,11 +84,11 @@ class PgDB:
|
||||||
self.con.rollback()
|
self.con.rollback()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def doSelect(self, sql):
|
def doSelect(self, sql, params):
|
||||||
""" Run SELECT SQL query and return result as dict """
|
""" Run SELECT SQL query and return result as dict """
|
||||||
cursor = self.con.cursor()
|
cursor = self.con.cursor()
|
||||||
try:
|
try:
|
||||||
cursor.execute(sql)
|
cursor.execute(sql, params)
|
||||||
results = cursor.fetchall()
|
results = cursor.fetchall()
|
||||||
return results
|
return results
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in a new issue