pgx_sql_entity_graph/metadata/
entity.rs

1/*!
2
3Function and type level metadata entities for Rust to SQL translation
4
5> Like all of the [`sql_entity_graph`][crate::pgx_sql_entity_graph] APIs, this is considered **internal**
6to the `pgx` framework and very subject to change between versions. While you may use this, please do it with caution.
7
8
9*/
10use super::{ArgumentError, Returns, ReturnsError, SqlMapping};
11
12#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
13pub struct FunctionMetadataEntity {
14    pub arguments: Vec<FunctionMetadataTypeEntity>,
15    pub retval: Option<FunctionMetadataTypeEntity>,
16    pub path: &'static str,
17}
18
19#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
20pub struct FunctionMetadataTypeEntity {
21    pub type_name: &'static str,
22    pub argument_sql: Result<SqlMapping, ArgumentError>,
23    pub return_sql: Result<Returns, ReturnsError>,
24    pub variadic: bool,
25    pub optional: bool,
26}