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