Macro diesel::debug_sql [] [src]

macro_rules! debug_sql {
    ($query:expr) => { ... };
}

Takes a query QueryFragment expression as an argument and returns a string of SQL with placeholders for the dynamic values.

Example

Returning SQL from a count statment:

let sql = debug_sql!(users.count());
assert_eq!(sql, "SELECT COUNT(*) FROM `users`");