PgDB: add possibility to provide query parameters on doSelect()

This commit is contained in:
Benjamin Renard 2021-07-12 12:18:38 +02:00
parent 6e778a8691
commit 21bd45ad25

View file

@ -84,11 +84,11 @@ class PgDB:
self.con.rollback()
return False
def doSelect(self, sql):
def doSelect(self, sql, params):
""" Run SELECT SQL query and return result as dict """
cursor = self.con.cursor()
try:
cursor.execute(sql)
cursor.execute(sql, params)
results = cursor.fetchall()
return results
except Exception: