feat: allow overriding query execution
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
89e85d0a9a
commit
886adfbc43
1 changed files with 4 additions and 1 deletions
|
|
@ -252,7 +252,7 @@ class Database:
|
|||
query += f" /* FRAPPE_TRACE_ID: {trace_id} */"
|
||||
|
||||
try:
|
||||
self._cursor.execute(query, values)
|
||||
self.execute_query(query, values)
|
||||
except Exception as e:
|
||||
if self.is_syntax_error(e):
|
||||
frappe.log(f"Syntax error in query:\n{query} {values or ''}")
|
||||
|
|
@ -346,6 +346,9 @@ class Database:
|
|||
|
||||
self._clean_up()
|
||||
|
||||
def execute_query(self, query, values=None):
|
||||
return self._cursor.execute(query, values)
|
||||
|
||||
def _log_query(
|
||||
self,
|
||||
mogrified_query: str,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue