macro_rules! name {
($name:tt, $ty:ty) => { ... };
}
Expand description
A macro for providing SQL names for the returned fields for functions that return a Rust tuple,
especially those that return a std::iter::Iterator<Item=(f1, f2, f3)>
Examples
This example will create a SQL function like so:
CREATE FUNCTION get_a_set() RETURNS TABLE (id integer, title text) ...;
use pgx::prelude::*;
#[pg_extern]
fn get_a_set() -> TableIterator<'static, (name!(id, i32), name!(title, &'static str))> {
TableIterator::new(vec![1, 2, 3].into_iter().zip(vec!["A", "B", "C"].into_iter()))
}