True for keywords which we want to quote when translating to SQL. Currently we're being fairly permissive (over-quoting is not a big concern). We're not including the full list from `SQL_KEYWORDS`, as that has terms such as `ID`, instead we bring a few dialects' keywords in.
(ident: &str, dialect: &Dialect)
| 13 | // We're not including the full list from `SQL_KEYWORDS`, as that has terms such |
| 14 | // as `ID`, instead we bring a few dialects' keywords in. |
| 15 | pub(super) fn is_keyword(ident: &str, dialect: &Dialect) -> bool { |
| 16 | let ident = ident.to_ascii_uppercase(); |
| 17 | |
| 18 | sql_keywords().contains(ident.as_str()) || dialect_keywords(dialect).contains(ident.as_str()) |
| 19 | } |
| 20 | |
| 21 | fn dialect_keywords(dialect: &Dialect) -> &'static HashSet<&'static str> { |
| 22 | match dialect { |
no test coverage detected