2 from sqlparse.sql import TokenList
3 from sqlparse.tokens import Name, Error
6 def requote_names(token_list):
7 """Remove backticks, quote non-lowercase identifiers"""
8 for token in token_list.flatten():
9 if token.ttype is Name:
11 if (value[0] == "`") and (value[-1] == "`"):
14 token.normalized = token.value = value
16 token.normalized = token.value = '"%s"' % value
19 def find_error(token_list):
21 for token in token_list.flatten():
22 if token.ttype is Error: