Skip to main content

is_select_query

Function is_select_query 

Source
pub fn is_select_query(sql: &str) -> bool
Expand description

Returns true if the SQL is a read-only query (SELECT, TABLE, SHOW, EXPLAIN).

Note: WITH (CTEs) is intentionally excluded because writeable CTEs (WITH ... UPDATE/INSERT/DELETE) also start with WITH. Users should write read-only CTEs starting with SELECT or use explicit subqueries.