pgx_utils/sql_entity_graph/pg_extern/entity/returning.rs
1/*
2Portions Copyright 2019-2021 ZomboDB, LLC.
3Portions Copyright 2021-2022 Technology Concepts & Design, Inc. <support@tcdi.com>
4
5All rights reserved.
6
7Use of this source code is governed by the MIT license that can be found in the LICENSE file.
8*/
9/*!
10
11`#[pg_extern]` related return value entities for Rust to SQL translation
12
13> Like all of the [`sql_entity_graph`][crate::sql_entity_graph] APIs, this is considered **internal**
14to the `pgx` framework and very subject to change between versions. While you may use this, please do it with caution.
15
16*/
17use crate::sql_entity_graph::UsedTypeEntity;
18
19#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
20pub enum PgExternReturnEntity {
21 None,
22 Type {
23 ty: UsedTypeEntity,
24 },
25 SetOf {
26 ty: UsedTypeEntity,
27 optional: bool, /* Eg `Option<SetOfIterator<T>>` */
28 },
29 Iterated {
30 tys: Vec<PgExternReturnEntityIteratedItem>,
31 optional: bool, /* Eg `Option<TableIterator<T>>` */
32 },
33 Trigger,
34}
35
36#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)]
37pub struct PgExternReturnEntityIteratedItem {
38 pub ty: UsedTypeEntity,
39 pub name: Option<&'static str>,
40}