Struct pgx_utils::sql_entity_graph::ExtensionSql
source · pub struct ExtensionSql {
pub sql: LitStr,
pub name: LitStr,
pub attrs: Punctuated<ExtensionSqlAttribute, Comma>,
}
Expand description
A parsed extension_sql!()
item.
It should be used with syn::parse::Parse
functions.
Using quote::ToTokens
will output the declaration for a pgx::utils::sql_entity_graph::ExtensionSqlEntity
.
use syn::{Macro, parse::Parse, parse_quote, parse};
use quote::{quote, ToTokens};
use pgx_utils::sql_entity_graph::ExtensionSql;
let parsed: Macro = parse_quote! {
extension_sql!("-- Example content", name = "example", bootstrap)
};
let inner_tokens = parsed.tokens;
let inner: ExtensionSql = parse_quote! {
#inner_tokens
};
let sql_graph_entity_tokens = inner.to_token_stream();
Fields§
§sql: LitStr
§name: LitStr
§attrs: Punctuated<ExtensionSqlAttribute, Comma>
Trait Implementations§
source§impl Clone for ExtensionSql
impl Clone for ExtensionSql
source§fn clone(&self) -> ExtensionSql
fn clone(&self) -> ExtensionSql
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more