Check if the query starts with any item from *prefixes*.
(formatted_sql, prefixes)
| 15 | |
| 16 | |
| 17 | def query_starts_with(formatted_sql, prefixes): |
| 18 | """Check if the query starts with any item from *prefixes*.""" |
| 19 | prefixes = [prefix.lower() for prefix in prefixes] |
| 20 | return bool(formatted_sql) and formatted_sql.split()[0] in prefixes |
| 21 | |
| 22 | |
| 23 | def query_is_unconditional_update(formatted_sql): |