diff options
Diffstat (limited to 'wqflask/utility/db_tools.py')
-rw-r--r-- | wqflask/utility/db_tools.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/wqflask/utility/db_tools.py b/wqflask/utility/db_tools.py deleted file mode 100644 index 98da33f2..00000000 --- a/wqflask/utility/db_tools.py +++ /dev/null @@ -1,23 +0,0 @@ -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): - """Create an in clause for mysql""" - in_clause = ', '.join("'{}'".format(x) for x in mescape(*items)) - in_clause = '( {} )'.format(in_clause) - return in_clause - - -def mescape(*items): - """Multiple escape""" - return [escape_(str(item)).decode('utf8') for item in items] - - -def escape(string_): - return escape_(string_).decode('utf8') |