aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/utility/db_tools.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/wqflask/utility/db_tools.py b/wqflask/utility/db_tools.py
index 6e19778f..98da33f2 100644
--- a/wqflask/utility/db_tools.py
+++ b/wqflask/utility/db_tools.py
@@ -1,4 +1,10 @@
-from MySQLdb import escape_string as escape_
+from utility.tools import get_setting
+from wqflask.database import database_connection
+
+
+def escape_(string):
+ with database_connection(get_setting("SQL_URI")) as conn:
+ return conn.escape_string(str(string))
def create_in_clause(items):