Skip to content

Commit a8cbb94

Browse files
carnegiemedalbhirsz
authored andcommitted
Update query.py
pass parameters argument to execute function
1 parent 8240bdb commit a8cbb94

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/DatabaseLibrary/query.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def query(
6969
try:
7070
cur = db_connection.client.cursor()
7171
logger.info(f"Executing : Query | {selectStatement} ")
72-
self.__execute_sql(cur, selectStatement)
72+
self.__execute_sql(cur, selectStatement, parameters=parameters)
7373
all_rows = cur.fetchall()
7474
if returnAsDict:
7575
col_names = [c[0] for c in cur.description]
@@ -115,7 +115,7 @@ def row_count(self, selectStatement: str, sansTran: bool = False, alias: Optiona
115115
try:
116116
cur = db_connection.client.cursor()
117117
logger.info(f"Executing : Row Count | {selectStatement}")
118-
self.__execute_sql(cur, selectStatement)
118+
self.__execute_sql(cur, selectStatement, parameters=parameters)
119119
data = cur.fetchall()
120120
if db_connection.module_name in ["sqlite3", "ibm_db", "ibm_db_dbi", "pyodbc"]:
121121
return len(data)
@@ -154,7 +154,7 @@ def description(self, selectStatement: str, sansTran: bool = False, alias: Optio
154154
try:
155155
cur = db_connection.client.cursor()
156156
logger.info("Executing : Description | {selectStatement}")
157-
self.__execute_sql(cur, selectStatement)
157+
self.__execute_sql(cur, selectStatement, parameters=parameters)
158158
description = list(cur.description)
159159
if sys.version_info[0] < 3:
160160
for row in range(0, len(description)):
@@ -356,7 +356,7 @@ def execute_sql_string(self, sqlString: str, sansTran: bool = False, alias: Opti
356356
try:
357357
cur = db_connection.client.cursor()
358358
logger.info(f"Executing : Execute SQL String | {sqlString}")
359-
self.__execute_sql(cur, sqlString)
359+
self.__execute_sql(cur, sqlString, parameters=parameters)
360360
if not sansTran:
361361
db_connection.client.commit()
362362
finally:

0 commit comments

Comments
 (0)