(sql: &str, width: i32, temp_storage: &'a RowArena)
| 2340 | |
| 2341 | #[sqlfunc(propagates_nulls = true)] |
| 2342 | fn pretty_sql<'a>(sql: &str, width: i32, temp_storage: &'a RowArena) -> Result<&'a str, EvalError> { |
| 2343 | let width = |
| 2344 | usize::try_from(width).map_err(|_| EvalError::PrettyError("invalid width".into()))?; |
| 2345 | let pretty = pretty_str( |
| 2346 | sql, |
| 2347 | PrettyConfig { |
| 2348 | width, |
| 2349 | format_mode: FormatMode::Simple, |
| 2350 | }, |
| 2351 | ) |
| 2352 | .map_err(|e| EvalError::PrettyError(e.to_string().into()))?; |
| 2353 | let pretty = temp_storage.push_string(pretty); |
| 2354 | Ok(pretty) |
| 2355 | } |
| 2356 | |
| 2357 | #[sqlfunc] |
| 2358 | fn redact_sql(sql: &str) -> Result<String, EvalError> { |
nothing calls this directly
no test coverage detected