(sql)
| 11 | return re.sub(r'(table|TABLE).+?\(.+?\)\s*;','',sql, flags=re.DOTALL) |
| 12 | |
| 13 | def clean_sql(sql): |
| 14 | tmp = [] |
| 15 | for token in sql.flatten(): |
| 16 | if not token.is_whitespace and not token.ttype is sqlparse.tokens.Comment.Single: |
| 17 | tmp.append(token) |
| 18 | return strip_par(' '.join(str(t) for t in tmp)) |
| 19 | |
| 20 | def strip_par(s): |
| 21 | for op in ['(',')',',','>','=','<','>=','<=','!=','<>','.',';']: |
no test coverage detected