Skip to main content

run_raw

Function run_raw 

Source
pub async fn run_raw(sql: &str) -> Result<Vec<Value>, AppError>
Expand description

Runs arbitrary, user-typed SQL and renders whatever comes back - see this module’s own doc comment for why this one is deliberately unrestricted. fetch_all works uniformly for both queries and statements: a SELECT returns real rows; INSERT/UPDATE/DELETE/ DDL return zero rows on success, so the same call reports “0 rows” rather than needing to sniff the statement’s kind from its text first.