macro_rules! raw_query {
($sql:expr) => { ... };
($sql:expr, $($params:expr),+ $(,)?) => { ... };
}Expand description
A macro for creating raw SQL queries with inline parameter binding.
§Example
ⓘ
let sql = raw_query!("SELECT * FROM users WHERE id = {} AND active = {}", user_id, true);The {} placeholders are replaced with database-specific parameter markers ($1, $2, etc.
for PostgreSQL, ? for MySQL/SQLite) and the values are bound as parameters.