substreams_database_change/pb/
sf.substreams.sink.database.v1.rs1#[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}
22pub mod table_change {
24 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
25 #[repr(i32)]
26 pub enum Operation {
27 Unspecified = 0,
29 Create = 1,
30 Update = 2,
31 Delete = 3,
32 Upsert = 4,
39 }
40 impl Operation {
41 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 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