macro_rules! baname {
( $n:expr ) => { ... };
( $n:expr, $( $x:expr ),* ) => { ... };
( $n:expr; $a:expr ) => { ... };
( $n:expr, $( $x:expr ),*; $a:expr ) => { ... };
}
Expand description
Make backquoted name of identifier.
ยงExamples
#[macro_use] extern crate sql_builder;
use sql_builder::{SqlBuilder, SqlName};
let sql = SqlBuilder::select_from(baname!("public", "BOOKS"; "b"))
.field(baname!("b", "title"))
.field(baname!("s", "total"))
.left()
.join(baname!("shops"; "s"))
.on_eq(baname!("b", "id"), baname!("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);