You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A exception is thrown (ValueError: None is not in list) if you have a text param that contains a sql keyword, module/sql line 76:
message = sqlparse.format(message, reindent=True, keyword_case='upper')
because the formatted_sql doesn't quote text param and sqlparse assumed that is a keyword not a regular text
i.e.:
sql = """INSERT INTO example ("name", "address") VALUES (%s, %s)"""
params = ("where", "other")
formatted_sql = sql % (params if isinstance(params, dict) else tuple(params))
message = sqlparse.format(message, reindent=True, keyword_case='upper')
The text was updated successfully, but these errors were encountered:
A exception is thrown (ValueError: None is not in list) if you have a text param that contains a sql keyword, module/sql line 76:
message = sqlparse.format(message, reindent=True, keyword_case='upper')
because the formatted_sql doesn't quote text param and sqlparse assumed that is a keyword not a regular text
i.e.:
sql = """INSERT INTO example ("name", "address") VALUES (%s, %s)"""
params = ("where", "other")
formatted_sql = sql % (params if isinstance(params, dict) else tuple(params))
message = sqlparse.format(message, reindent=True, keyword_case='upper')
The text was updated successfully, but these errors were encountered: