pub fn classify_sql(sql: &str) -> Result<SqlClassification>Expand description
Classify a SQL statement as read-only or rejected.
Uses a whitelist-only approach: only SELECT queries and EXPLAIN (without ANALYZE)
are allowed. All other statements are rejected.
§Arguments
sql- The SQL statement to classify
§Returns
Ok(SqlClassification::ReadOnly)if the statement is safeOk(SqlClassification::Rejected(reason))if the statement is not allowedErrif parsing fails
§Errors
Returns a validation error if the SQL cannot be parsed.