Skip to main content

check_identifier

Function check_identifier 

Source
pub fn check_identifier(raw_name: &str) -> Result<String, SqlError>
Expand description

Validate a raw identifier token extracted from SQL.

  • If raw_name is surrounded by double-quotes (standard SQL quoting), the quotes are stripped and the inner text is returned unchanged as Ok(inner) — the user has opted in to the reserved word.
  • Otherwise, the token is normalised to upper case and compared against RESERVED_KEYWORDS. A match returns Err(SqlError::ReservedIdentifier { .. }) with an actionable hint.
  • A clean identifier is returned as Ok(name.to_lowercase()) to match the existing parse_col_token behaviour.