macro_rules! qname {
( $n:expr ) => { ... };
( $n:expr, $( $x:expr ),* ) => { ... };
( $n:expr; $a:expr ) => { ... };
( $n:expr, $( $x:expr ),*; $a:expr ) => { ... };
}
Expand description
Make quoted name of identifier.
ยงExamples
#[macro_use] extern crate sql_builder;
use sql_builder::{SqlBuilder, SqlName};
let sql = SqlBuilder::select_from(qname!("public", "BOOKS"; "b"))
.field(qname!("b", "title"))
.field(qname!("s", "total"))
.left()
.join(qname!("shops"; "s"))
.on_eq(qname!("b", "id"), qname!("s", "book"))
.sql()?;
assert_eq!("SELECT 'b'.'title', 's'.'total' FROM 'public'.'BOOKS' AS b LEFT JOIN 'shops' AS s ON 'b'.'id' = 's'.'book';", &sql);