(query_upper: &str, table_name: &str)
| 752 | } |
| 753 | |
| 754 | fn query_mentions_table(query_upper: &str, table_name: &str) -> bool { |
| 755 | let table_upper = table_name.to_uppercase(); |
| 756 | query_upper |
| 757 | .split(|c: char| !c.is_ascii_alphanumeric() && c != '_') |
| 758 | .any(|token| token == table_upper) |
| 759 | } |
| 760 | |
| 761 | /// Detect which tables are needed from a SQL query. |
| 762 | /// |