substreams_database_change/pb/
sf.substreams.sink.database.v1.rs

1// @generated
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct DatabaseChanges {
5    #[prost(message, repeated, tag="1")]
6    pub table_changes: ::prost::alloc::vec::Vec<TableChange>,
7}
8#[allow(clippy::derive_partial_eq_without_eq)]
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct TableChange {
11    #[prost(string, tag="1")]
12    pub table: ::prost::alloc::string::String,
13    #[prost(uint64, tag="3")]
14    pub ordinal: u64,
15    #[prost(enumeration="table_change::Operation", tag="4")]
16    pub operation: i32,
17    #[prost(message, repeated, tag="5")]
18    pub fields: ::prost::alloc::vec::Vec<Field>,
19    #[prost(oneof="table_change::PrimaryKey", tags="2, 6")]
20    pub primary_key: ::core::option::Option<table_change::PrimaryKey>,
21}
22/// Nested message and enum types in `TableChange`.
23pub mod table_change {
24    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
25    #[repr(i32)]
26    pub enum Operation {
27        /// Protobuf default should not be used, this is used so that the consume can ensure that the value was actually specified
28        Unspecified = 0,
29        Create = 1,
30        Update = 2,
31        Delete = 3,
32        /// The upsert might not be supported by all drivers the sink supports,
33        /// refer to <https://github.com/streamingfast/substreams-sink-sql> for
34        /// which drivers support it.
35        ///
36        /// At time of writing, the Postgres driver supports was the only one supporting
37        /// it.
38        Upsert = 4,
39    }
40    impl Operation {
41        /// String value of the enum field names used in the ProtoBuf definition.
42        ///
43        /// The values are not transformed in any way and thus are considered stable
44        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
45        pub fn as_str_name(&self) -> &'static str {
46            match self {
47                Operation::Unspecified => "OPERATION_UNSPECIFIED",
48                Operation::Create => "OPERATION_CREATE",
49                Operation::Update => "OPERATION_UPDATE",
50                Operation::Delete => "OPERATION_DELETE",
51                Operation::Upsert => "OPERATION_UPSERT",
52            }
53        }
54        /// Creates an enum from field names used in the ProtoBuf definition.
55        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
56            match value {
57                "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
58                "OPERATION_CREATE" => Some(Self::Create),
59                "OPERATION_UPDATE" => Some(Self::Update),
60                "OPERATION_DELETE" => Some(Self::Delete),
61                "OPERATION_UPSERT" => Some(Self::Upsert),
62                _ => None,
63            }
64        }
65    }
66    #[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Oneof)]
68    pub enum PrimaryKey {
69        #[prost(string, tag="2")]
70        Pk(::prost::alloc::string::String),
71        #[prost(message, tag="6")]
72        CompositePk(super::CompositePrimaryKey),
73    }
74}
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct CompositePrimaryKey {
78    #[prost(map="string, string", tag="1")]
79    pub keys: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
80}
81#[allow(clippy::derive_partial_eq_without_eq)]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct Field {
84    #[prost(string, tag="1")]
85    pub name: ::prost::alloc::string::String,
86    #[prost(string, tag="2")]
87    pub new_value: ::prost::alloc::string::String,
88    #[prost(string, tag="3")]
89    pub old_value: ::prost::alloc::string::String,
90}
91// @@protoc_insertion_point(module)