Skip to main content

risingwave_pb/
catalog.rs

1// This file is @generated by prost-build.
2/// A mapping of column indices.
3#[derive(prost_helpers::AnyPB)]
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct ColIndexMapping {
6    /// The size of the target space.
7    #[prost(uint64, tag = "1")]
8    pub target_size: u64,
9    /// Each subscript is mapped to the corresponding element.
10    /// For those not mapped, the value will be negative.
11    #[prost(int64, repeated, tag = "2")]
12    pub map: ::prost::alloc::vec::Vec<i64>,
13}
14#[derive(prost_helpers::AnyPB)]
15#[derive(Eq, Hash)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct WatermarkDesc {
18    /// The column idx the watermark is on
19    #[prost(uint32, tag = "1")]
20    pub watermark_idx: u32,
21    /// The expression to calculate the watermark value.
22    #[prost(message, optional, tag = "2")]
23    pub expr: ::core::option::Option<super::expr::ExprNode>,
24    /// Whether this watermark is used for TTL (`WITH TTL`).
25    #[prost(bool, tag = "3")]
26    pub with_ttl: bool,
27}
28#[derive(prost_helpers::AnyPB)]
29#[derive(Eq, Hash)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct StreamSourceInfo {
32    /// deprecated
33    #[prost(enumeration = "super::plan_common::RowFormatType", tag = "1")]
34    pub row_format: i32,
35    #[prost(string, tag = "2")]
36    pub row_schema_location: ::prost::alloc::string::String,
37    /// This means *use **confluent** schema registry* and is `false` for **aws glue** schema registry.
38    /// Eventually we will deprecate it and rely on `enum SchemaLocation` derived from `format_encode_options` below.
39    ///
40    /// * schema.location     false
41    /// * schema.registry     true
42    /// * aws.glue.schema_arn false
43    #[prost(bool, tag = "3")]
44    pub use_schema_registry: bool,
45    #[prost(string, tag = "4")]
46    pub proto_message_name: ::prost::alloc::string::String,
47    #[prost(int32, tag = "5")]
48    pub csv_delimiter: i32,
49    #[prost(bool, tag = "6")]
50    pub csv_has_header: bool,
51    #[prost(enumeration = "super::plan_common::FormatType", tag = "8")]
52    pub format: i32,
53    #[prost(enumeration = "super::plan_common::EncodeType", tag = "9")]
54    pub row_encode: i32,
55    #[prost(enumeration = "SchemaRegistryNameStrategy", tag = "10")]
56    pub name_strategy: i32,
57    #[prost(string, optional, tag = "11")]
58    pub key_message_name: ::core::option::Option<::prost::alloc::string::String>,
59    #[prost(message, optional, tag = "12")]
60    pub external_table: ::core::option::Option<super::plan_common::ExternalTableDesc>,
61    /// **This field should now be called `is_shared`.** Not renamed for backwards
62    /// compatibility.
63    ///
64    /// Whether the stream source is a shared source (it has a streaming job).
65    /// This is related with [RFC: Reusable Source
66    /// Executor](<https://github.com/risingwavelabs/rfcs/pull/72>).
67    ///
68    /// Currently, the following sources can be shared:
69    ///
70    /// * Direct CDC sources (mysql & postgresql & sqlserver)
71    /// * MQ sources (Kafka)
72    #[prost(bool, tag = "13")]
73    pub cdc_source_job: bool,
74    /// Only used when `cdc_source_job` is `true`.
75    /// If `false`, `requires_singleton` will be set in the stream plan.
76    ///
77    /// * Direct CDC sources: `false`
78    /// * MQ sources (Kafka): `true`
79    #[prost(bool, tag = "15")]
80    pub is_distributed: bool,
81    /// Options specified by user in the FORMAT ENCODE clause.
82    #[prost(btree_map = "string, string", tag = "14")]
83    pub format_encode_options: ::prost::alloc::collections::BTreeMap<
84        ::prost::alloc::string::String,
85        ::prost::alloc::string::String,
86    >,
87    /// Handle the source relies on any sceret. The key is the propertity name and the value is the secret id and type.
88    /// For format and encode options.
89    #[prost(btree_map = "string, message", tag = "16")]
90    pub format_encode_secret_refs: ::prost::alloc::collections::BTreeMap<
91        ::prost::alloc::string::String,
92        super::secret::SecretRef,
93    >,
94    /// ref connection for schema registry
95    #[prost(uint32, optional, tag = "17", wrapper = "crate::id::ConnectionId")]
96    pub connection_id: ::core::option::Option<crate::id::ConnectionId>,
97}
98#[derive(prost_helpers::AnyPB)]
99#[derive(Eq, Hash)]
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct WebhookSourceInfo {
102    #[prost(message, optional, tag = "1")]
103    pub secret_ref: ::core::option::Option<super::secret::SecretRef>,
104    #[prost(message, optional, tag = "2")]
105    pub signature_expr: ::core::option::Option<super::expr::ExprNode>,
106    /// Return until the data is persisted in the storage layer or not. Default is true.
107    #[prost(bool, tag = "3")]
108    pub wait_for_persistence: bool,
109    /// Whether request is batched as jsonl. Default is false.
110    #[prost(bool, tag = "4")]
111    pub is_batched: bool,
112}
113#[derive(prost_helpers::AnyPB)]
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct Source {
116    /// For shared source, this is the same as the job id.
117    /// For non-shared source and table with connector, this is a different oid.
118    #[prost(uint32, tag = "1", wrapper = "crate::id::SourceId")]
119    pub id: crate::id::SourceId,
120    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
121    pub schema_id: crate::id::SchemaId,
122    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
123    pub database_id: crate::id::DatabaseId,
124    #[prost(string, tag = "4")]
125    pub name: ::prost::alloc::string::String,
126    /// The column index of row ID. If the primary key is specified by the user,
127    /// this will be `None`.
128    #[prost(uint32, optional, tag = "5")]
129    pub row_id_index: ::core::option::Option<u32>,
130    /// Columns of the source.
131    #[prost(message, repeated, tag = "6")]
132    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
133    /// Column id of the primary key specified by the user. If the user does not
134    /// specify a primary key, the vector will be empty.
135    #[prost(int32, repeated, tag = "7")]
136    pub pk_column_ids: ::prost::alloc::vec::Vec<i32>,
137    /// Properties specified by the user in WITH clause.
138    #[prost(btree_map = "string, string", tag = "8")]
139    pub with_properties: ::prost::alloc::collections::BTreeMap<
140        ::prost::alloc::string::String,
141        ::prost::alloc::string::String,
142    >,
143    #[prost(uint32, tag = "9", wrapper = "crate::id::UserId")]
144    pub owner: crate::id::UserId,
145    #[prost(message, optional, tag = "10")]
146    pub info: ::core::option::Option<StreamSourceInfo>,
147    /// Define watermarks on the source. The `repeated` is just for forward
148    /// compatibility, currently, only one watermark on the source
149    #[prost(message, repeated, tag = "11")]
150    pub watermark_descs: ::prost::alloc::vec::Vec<WatermarkDesc>,
151    #[prost(string, tag = "13")]
152    pub definition: ::prost::alloc::string::String,
153    /// ref connection for connector
154    #[prost(uint32, optional, tag = "14", wrapper = "crate::id::ConnectionId")]
155    pub connection_id: ::core::option::Option<crate::id::ConnectionId>,
156    #[prost(uint64, optional, tag = "15")]
157    pub initialized_at_epoch: ::core::option::Option<u64>,
158    #[prost(uint64, optional, tag = "16")]
159    pub created_at_epoch: ::core::option::Option<u64>,
160    /// Cluster version (tracked by git commit) when initialized/created
161    #[prost(string, optional, tag = "17")]
162    pub initialized_at_cluster_version: ::core::option::Option<
163        ::prost::alloc::string::String,
164    >,
165    #[prost(string, optional, tag = "18")]
166    pub created_at_cluster_version: ::core::option::Option<
167        ::prost::alloc::string::String,
168    >,
169    /// Handle the source relies on any sceret. The key is the propertity name and the value is the secret id.
170    /// Used for secret connect options.
171    #[prost(btree_map = "string, message", tag = "19")]
172    pub secret_refs: ::prost::alloc::collections::BTreeMap<
173        ::prost::alloc::string::String,
174        super::secret::SecretRef,
175    >,
176    /// How the source ingests data: streaming, full reload, or bounded.
177    #[prost(message, optional, tag = "20")]
178    pub ingest_mode: ::core::option::Option<super::plan_common::SourceIngestMode>,
179    /// Per-source catalog version, used by schema change.
180    #[prost(uint64, tag = "100")]
181    pub version: u64,
182    #[prost(uint32, optional, tag = "101")]
183    pub rate_limit: ::core::option::Option<u32>,
184    /// Indicate whether this source is created by table.
185    #[prost(oneof = "source::OptionalAssociatedTableId", tags = "12")]
186    pub optional_associated_table_id: ::core::option::Option<
187        source::OptionalAssociatedTableId,
188    >,
189}
190/// Nested message and enum types in `Source`.
191pub mod source {
192    /// Indicate whether this source is created by table.
193    #[derive(prost_helpers::AnyPB)]
194    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
195    pub enum OptionalAssociatedTableId {
196        #[prost(uint32, tag = "12", wrapper = "crate::id::TableId")]
197        AssociatedTableId(crate::id::TableId),
198    }
199}
200/// Similar to `StreamSourceInfo`, and may replace `SinkType` later.
201#[derive(prost_helpers::AnyPB)]
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct SinkFormatDesc {
204    #[prost(enumeration = "super::plan_common::FormatType", tag = "1")]
205    pub format: i32,
206    #[prost(enumeration = "super::plan_common::EncodeType", tag = "2")]
207    pub encode: i32,
208    #[prost(btree_map = "string, string", tag = "3")]
209    pub options: ::prost::alloc::collections::BTreeMap<
210        ::prost::alloc::string::String,
211        ::prost::alloc::string::String,
212    >,
213    #[prost(enumeration = "super::plan_common::EncodeType", optional, tag = "4")]
214    pub key_encode: ::core::option::Option<i32>,
215    /// Secret used for format encode options.
216    #[prost(btree_map = "string, message", tag = "5")]
217    pub secret_refs: ::prost::alloc::collections::BTreeMap<
218        ::prost::alloc::string::String,
219        super::secret::SecretRef,
220    >,
221    /// ref connection for schema registry
222    #[prost(uint32, optional, tag = "6", wrapper = "crate::id::ConnectionId")]
223    pub connection_id: ::core::option::Option<crate::id::ConnectionId>,
224}
225/// the catalog of the sink. There are two kind of schema here. The full schema is all columns
226/// stored in the `column` which is the sink executor/fragment's output schema. The visible
227/// schema contains the columns whose `is_hidden` is false, which is the columns sink out to the
228/// external system. The distribution key and all other keys are indexed in the full schema.
229#[derive(prost_helpers::AnyPB)]
230#[derive(Clone, PartialEq, ::prost::Message)]
231pub struct Sink {
232    #[prost(uint32, tag = "1", wrapper = "crate::id::SinkId")]
233    pub id: crate::id::SinkId,
234    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
235    pub schema_id: crate::id::SchemaId,
236    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
237    pub database_id: crate::id::DatabaseId,
238    #[prost(string, tag = "4")]
239    pub name: ::prost::alloc::string::String,
240    #[prost(message, repeated, tag = "5")]
241    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
242    /// Primary key derived from the SQL by the frontend.
243    #[prost(message, repeated, tag = "6")]
244    pub plan_pk: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
245    #[prost(int32, repeated, tag = "8")]
246    pub distribution_key: ::prost::alloc::vec::Vec<i32>,
247    /// User-defined primary key indices for the upsert sink.
248    #[prost(int32, repeated, tag = "9")]
249    pub downstream_pk: ::prost::alloc::vec::Vec<i32>,
250    /// to be deprecated
251    #[prost(enumeration = "SinkType", tag = "10")]
252    pub sink_type: i32,
253    #[prost(uint32, tag = "11", wrapper = "crate::id::UserId")]
254    pub owner: crate::id::UserId,
255    #[prost(btree_map = "string, string", tag = "12")]
256    pub properties: ::prost::alloc::collections::BTreeMap<
257        ::prost::alloc::string::String,
258        ::prost::alloc::string::String,
259    >,
260    #[prost(string, tag = "13")]
261    pub definition: ::prost::alloc::string::String,
262    /// ref connection for connector
263    #[prost(uint32, optional, tag = "14", wrapper = "crate::id::ConnectionId")]
264    pub connection_id: ::core::option::Option<crate::id::ConnectionId>,
265    #[prost(uint64, optional, tag = "15")]
266    pub initialized_at_epoch: ::core::option::Option<u64>,
267    #[prost(uint64, optional, tag = "16")]
268    pub created_at_epoch: ::core::option::Option<u64>,
269    #[prost(string, tag = "17")]
270    pub db_name: ::prost::alloc::string::String,
271    #[prost(string, tag = "18")]
272    pub sink_from_name: ::prost::alloc::string::String,
273    #[prost(enumeration = "StreamJobStatus", tag = "19")]
274    pub stream_job_status: i32,
275    #[prost(message, optional, tag = "20")]
276    pub format_desc: ::core::option::Option<SinkFormatDesc>,
277    /// Target table id (only applicable for table sink)
278    #[prost(uint32, optional, tag = "21", wrapper = "crate::id::TableId")]
279    pub target_table: ::core::option::Option<crate::id::TableId>,
280    /// Cluster version (tracked by git commit) when initialized/created
281    #[prost(string, optional, tag = "22")]
282    pub initialized_at_cluster_version: ::core::option::Option<
283        ::prost::alloc::string::String,
284    >,
285    #[prost(string, optional, tag = "23")]
286    pub created_at_cluster_version: ::core::option::Option<
287        ::prost::alloc::string::String,
288    >,
289    /// Whether it should use background ddl or block until backfill finishes.
290    #[prost(enumeration = "CreateType", tag = "24")]
291    pub create_type: i32,
292    /// Handle the sink relies on any sceret. The key is the propertity name and the value is the secret id and type.
293    /// Used for connect options.
294    #[prost(btree_map = "string, message", tag = "25")]
295    pub secret_refs: ::prost::alloc::collections::BTreeMap<
296        ::prost::alloc::string::String,
297        super::secret::SecretRef,
298    >,
299    /// only for the sink whose target is a table. Columns of the target table when the sink is created. At this point all the default columns of the target table are all handled by the project operator in the sink plan.
300    #[prost(message, repeated, tag = "26")]
301    pub original_target_columns: ::prost::alloc::vec::Vec<
302        super::plan_common::ColumnCatalog,
303    >,
304    #[prost(uint32, optional, tag = "27", wrapper = "crate::id::TableId")]
305    pub auto_refresh_schema_from_table: ::core::option::Option<crate::id::TableId>,
306    /// Backward-compatible replacement for `SINK_TYPE_FORCE_APPEND_ONLY`.
307    /// When set, the sink executor will drop DELETE messages and convert UPDATE messages to INSERT.
308    ///
309    /// Should not directly access this field. Use method `ignore_delete()` instead.
310    #[prost(bool, tag = "28")]
311    pub raw_ignore_delete: bool,
312}
313#[derive(prost_helpers::AnyPB)]
314#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
315pub struct Subscription {
316    #[prost(uint32, tag = "1", wrapper = "crate::id::SubscriptionId")]
317    pub id: crate::id::SubscriptionId,
318    #[prost(string, tag = "2")]
319    pub name: ::prost::alloc::string::String,
320    #[prost(string, tag = "3")]
321    pub definition: ::prost::alloc::string::String,
322    #[prost(uint64, tag = "6")]
323    pub retention_seconds: u64,
324    #[prost(uint32, tag = "8", wrapper = "crate::id::DatabaseId")]
325    pub database_id: crate::id::DatabaseId,
326    #[prost(uint32, tag = "9", wrapper = "crate::id::SchemaId")]
327    pub schema_id: crate::id::SchemaId,
328    #[prost(uint32, tag = "10", wrapper = "crate::id::TableId")]
329    pub dependent_table_id: crate::id::TableId,
330    #[prost(uint64, optional, tag = "11")]
331    pub initialized_at_epoch: ::core::option::Option<u64>,
332    #[prost(uint64, optional, tag = "12")]
333    pub created_at_epoch: ::core::option::Option<u64>,
334    #[prost(uint32, tag = "13", wrapper = "crate::id::UserId")]
335    pub owner: crate::id::UserId,
336    #[prost(string, optional, tag = "15")]
337    pub initialized_at_cluster_version: ::core::option::Option<
338        ::prost::alloc::string::String,
339    >,
340    #[prost(string, optional, tag = "16")]
341    pub created_at_cluster_version: ::core::option::Option<
342        ::prost::alloc::string::String,
343    >,
344    #[prost(enumeration = "subscription::SubscriptionState", tag = "19")]
345    pub subscription_state: i32,
346}
347/// Nested message and enum types in `Subscription`.
348pub mod subscription {
349    #[derive(prost_helpers::AnyPB)]
350    #[derive(
351        Clone,
352        Copy,
353        Debug,
354        PartialEq,
355        Eq,
356        Hash,
357        PartialOrd,
358        Ord,
359        ::prost::Enumeration
360    )]
361    #[repr(i32)]
362    pub enum SubscriptionState {
363        Unspecified = 0,
364        Init = 1,
365        Created = 2,
366    }
367    impl SubscriptionState {
368        /// String value of the enum field names used in the ProtoBuf definition.
369        ///
370        /// The values are not transformed in any way and thus are considered stable
371        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
372        pub fn as_str_name(&self) -> &'static str {
373            match self {
374                Self::Unspecified => "UNSPECIFIED",
375                Self::Init => "INIT",
376                Self::Created => "CREATED",
377            }
378        }
379        /// Creates an enum from field names used in the ProtoBuf definition.
380        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
381            match value {
382                "UNSPECIFIED" => Some(Self::Unspecified),
383                "INIT" => Some(Self::Init),
384                "CREATED" => Some(Self::Created),
385                _ => None,
386            }
387        }
388    }
389}
390#[derive(prost_helpers::AnyPB)]
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct ConnectionParams {
393    #[prost(enumeration = "connection_params::ConnectionType", tag = "1")]
394    pub connection_type: i32,
395    #[prost(map = "string, string", tag = "2")]
396    pub properties: ::std::collections::HashMap<
397        ::prost::alloc::string::String,
398        ::prost::alloc::string::String,
399    >,
400    #[prost(map = "string, message", tag = "3")]
401    pub secret_refs: ::std::collections::HashMap<
402        ::prost::alloc::string::String,
403        super::secret::SecretRef,
404    >,
405}
406/// Nested message and enum types in `ConnectionParams`.
407pub mod connection_params {
408    #[derive(prost_helpers::AnyPB)]
409    #[derive(
410        Clone,
411        Copy,
412        Debug,
413        PartialEq,
414        Eq,
415        Hash,
416        PartialOrd,
417        Ord,
418        ::prost::Enumeration
419    )]
420    #[repr(i32)]
421    pub enum ConnectionType {
422        Unspecified = 0,
423        Kafka = 1,
424        Iceberg = 2,
425        SchemaRegistry = 3,
426        Elasticsearch = 4,
427    }
428    impl ConnectionType {
429        /// String value of the enum field names used in the ProtoBuf definition.
430        ///
431        /// The values are not transformed in any way and thus are considered stable
432        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
433        pub fn as_str_name(&self) -> &'static str {
434            match self {
435                Self::Unspecified => "CONNECTION_TYPE_UNSPECIFIED",
436                Self::Kafka => "CONNECTION_TYPE_KAFKA",
437                Self::Iceberg => "CONNECTION_TYPE_ICEBERG",
438                Self::SchemaRegistry => "CONNECTION_TYPE_SCHEMA_REGISTRY",
439                Self::Elasticsearch => "CONNECTION_TYPE_ELASTICSEARCH",
440            }
441        }
442        /// Creates an enum from field names used in the ProtoBuf definition.
443        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
444            match value {
445                "CONNECTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
446                "CONNECTION_TYPE_KAFKA" => Some(Self::Kafka),
447                "CONNECTION_TYPE_ICEBERG" => Some(Self::Iceberg),
448                "CONNECTION_TYPE_SCHEMA_REGISTRY" => Some(Self::SchemaRegistry),
449                "CONNECTION_TYPE_ELASTICSEARCH" => Some(Self::Elasticsearch),
450                _ => None,
451            }
452        }
453    }
454}
455#[derive(prost_helpers::AnyPB)]
456#[derive(Clone, PartialEq, ::prost::Message)]
457pub struct Connection {
458    #[prost(uint32, tag = "1", wrapper = "crate::id::ConnectionId")]
459    pub id: crate::id::ConnectionId,
460    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
461    pub schema_id: crate::id::SchemaId,
462    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
463    pub database_id: crate::id::DatabaseId,
464    #[prost(string, tag = "4")]
465    pub name: ::prost::alloc::string::String,
466    #[prost(uint32, tag = "6", wrapper = "crate::id::UserId")]
467    pub owner: crate::id::UserId,
468    #[prost(oneof = "connection::Info", tags = "5, 7")]
469    pub info: ::core::option::Option<connection::Info>,
470}
471/// Nested message and enum types in `Connection`.
472pub mod connection {
473    #[derive(prost_helpers::AnyPB)]
474    #[derive(Clone, PartialEq, ::prost::Message)]
475    pub struct PrivateLinkService {
476        #[prost(enumeration = "private_link_service::PrivateLinkProvider", tag = "1")]
477        pub provider: i32,
478        #[prost(string, tag = "2")]
479        pub service_name: ::prost::alloc::string::String,
480        #[prost(string, tag = "3")]
481        pub endpoint_id: ::prost::alloc::string::String,
482        #[prost(map = "string, string", tag = "4")]
483        pub dns_entries: ::std::collections::HashMap<
484            ::prost::alloc::string::String,
485            ::prost::alloc::string::String,
486        >,
487        #[prost(string, tag = "5")]
488        pub endpoint_dns_name: ::prost::alloc::string::String,
489    }
490    /// Nested message and enum types in `PrivateLinkService`.
491    pub mod private_link_service {
492        #[derive(prost_helpers::AnyPB)]
493        #[derive(
494            Clone,
495            Copy,
496            Debug,
497            PartialEq,
498            Eq,
499            Hash,
500            PartialOrd,
501            Ord,
502            ::prost::Enumeration
503        )]
504        #[repr(i32)]
505        pub enum PrivateLinkProvider {
506            Unspecified = 0,
507            Mock = 1,
508            Aws = 2,
509        }
510        impl PrivateLinkProvider {
511            /// String value of the enum field names used in the ProtoBuf definition.
512            ///
513            /// The values are not transformed in any way and thus are considered stable
514            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
515            pub fn as_str_name(&self) -> &'static str {
516                match self {
517                    Self::Unspecified => "UNSPECIFIED",
518                    Self::Mock => "MOCK",
519                    Self::Aws => "AWS",
520                }
521            }
522            /// Creates an enum from field names used in the ProtoBuf definition.
523            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
524                match value {
525                    "UNSPECIFIED" => Some(Self::Unspecified),
526                    "MOCK" => Some(Self::Mock),
527                    "AWS" => Some(Self::Aws),
528                    _ => None,
529                }
530            }
531        }
532    }
533    #[derive(prost_helpers::AnyPB)]
534    #[derive(Clone, PartialEq, ::prost::Oneof)]
535    pub enum Info {
536        #[deprecated]
537        #[prost(message, tag = "5")]
538        PrivateLinkService(PrivateLinkService),
539        #[prost(message, tag = "7")]
540        ConnectionParams(super::ConnectionParams),
541    }
542}
543#[derive(prost_helpers::AnyPB)]
544#[derive(Clone, PartialEq, ::prost::Message)]
545pub struct Index {
546    #[prost(uint32, tag = "1", wrapper = "crate::id::IndexId")]
547    pub id: crate::id::IndexId,
548    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
549    pub schema_id: crate::id::SchemaId,
550    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
551    pub database_id: crate::id::DatabaseId,
552    #[prost(string, tag = "4")]
553    pub name: ::prost::alloc::string::String,
554    #[prost(uint32, tag = "5", wrapper = "crate::id::UserId")]
555    pub owner: crate::id::UserId,
556    #[prost(uint32, tag = "6", wrapper = "crate::id::TableId")]
557    pub index_table_id: crate::id::TableId,
558    #[prost(uint32, tag = "7", wrapper = "crate::id::TableId")]
559    pub primary_table_id: crate::id::TableId,
560    /// Only `InputRef` type index is supported Now.
561    /// The index of `InputRef` is the column index of the primary table.
562    #[prost(message, repeated, tag = "8")]
563    pub index_item: ::prost::alloc::vec::Vec<super::expr::ExprNode>,
564    #[prost(message, repeated, tag = "16")]
565    pub index_column_properties: ::prost::alloc::vec::Vec<IndexColumnProperties>,
566    #[prost(uint64, optional, tag = "10")]
567    pub initialized_at_epoch: ::core::option::Option<u64>,
568    #[prost(uint64, optional, tag = "11")]
569    pub created_at_epoch: ::core::option::Option<u64>,
570    #[prost(enumeration = "StreamJobStatus", tag = "12")]
571    pub stream_job_status: i32,
572    /// Use to record the prefix len of the index_item to reconstruct index columns
573    /// provided by users.
574    #[prost(uint32, tag = "13")]
575    pub index_columns_len: u32,
576    /// Cluster version (tracked by git commit) when initialized/created
577    #[prost(string, optional, tag = "14")]
578    pub initialized_at_cluster_version: ::core::option::Option<
579        ::prost::alloc::string::String,
580    >,
581    #[prost(string, optional, tag = "15")]
582    pub created_at_cluster_version: ::core::option::Option<
583        ::prost::alloc::string::String,
584    >,
585    /// Whether it should use background ddl or block until backfill finishes.
586    #[prost(enumeration = "CreateType", tag = "17")]
587    pub create_type: i32,
588}
589/// <https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-INDEX-COLUMN-PROPS>
590#[derive(prost_helpers::AnyPB)]
591#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
592pub struct IndexColumnProperties {
593    /// Whether the column sort in ascending(false) or descending(true) order on a forward scan.
594    #[prost(bool, tag = "1")]
595    pub is_desc: bool,
596    /// Does the column sort with nulls first on a forward scan?
597    #[prost(bool, tag = "2")]
598    pub nulls_first: bool,
599}
600#[derive(prost_helpers::AnyPB)]
601#[derive(Clone, PartialEq, ::prost::Message)]
602pub struct Function {
603    #[prost(uint32, tag = "1", wrapper = "crate::id::FunctionId")]
604    pub id: crate::id::FunctionId,
605    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
606    pub schema_id: crate::id::SchemaId,
607    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
608    pub database_id: crate::id::DatabaseId,
609    #[prost(string, tag = "4")]
610    pub name: ::prost::alloc::string::String,
611    #[prost(uint32, tag = "9", wrapper = "crate::id::UserId")]
612    pub owner: crate::id::UserId,
613    #[prost(string, repeated, tag = "15")]
614    pub arg_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
615    #[prost(message, repeated, tag = "5")]
616    pub arg_types: ::prost::alloc::vec::Vec<super::data::DataType>,
617    #[prost(message, optional, tag = "6")]
618    pub return_type: ::core::option::Option<super::data::DataType>,
619    #[prost(string, tag = "7")]
620    pub language: ::prost::alloc::string::String,
621    #[prost(string, optional, tag = "8")]
622    pub link: ::core::option::Option<::prost::alloc::string::String>,
623    /// The function name in the runtime / on the remote side that is bound to the UDF created in RisingWave.
624    #[prost(string, optional, tag = "10")]
625    pub name_in_runtime: ::core::option::Option<::prost::alloc::string::String>,
626    /// The source code of the function.
627    #[prost(string, optional, tag = "14")]
628    pub body: ::core::option::Option<::prost::alloc::string::String>,
629    /// The zstd-compressed binary of the function.
630    #[prost(bytes = "vec", optional, tag = "17")]
631    pub compressed_binary: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
632    #[prost(bool, tag = "16")]
633    pub always_retry_on_network_error: bool,
634    /// The runtime selected when multiple runtimes are available for the language. Now is not used.
635    #[prost(string, optional, tag = "18")]
636    pub runtime: ::core::option::Option<::prost::alloc::string::String>,
637    /// additional options for javascript functions
638    #[prost(bool, optional, tag = "20")]
639    pub is_async: ::core::option::Option<bool>,
640    #[prost(bool, optional, tag = "21")]
641    pub is_batched: ::core::option::Option<bool>,
642    #[prost(uint64, optional, tag = "22")]
643    pub created_at_epoch: ::core::option::Option<u64>,
644    /// Cluster version (tracked by git commit) when created
645    #[prost(string, optional, tag = "23")]
646    pub created_at_cluster_version: ::core::option::Option<
647        ::prost::alloc::string::String,
648    >,
649    /// Unsafe: whether to skip materializing evaluated results of this function for retractable
650    /// streams. Re-evaluation can produce inconsistent results or fail if the function is not truly
651    /// deterministic and side-effect-free. Only supported for scalar functions; other kinds reject the
652    /// option. False by default.
653    #[prost(bool, tag = "24")]
654    pub unsafe_skip_materializing_exprs: bool,
655    /// Whether the function is declared `IMMUTABLE`. The planner trusts the declaration and treats
656    /// the function as pure when all of its arguments are pure. Only supported for scalar functions;
657    /// other kinds reject `IMMUTABLE`. False by default.
658    #[prost(bool, tag = "25")]
659    pub is_immutable: bool,
660    #[prost(oneof = "function::Kind", tags = "11, 12, 13")]
661    pub kind: ::core::option::Option<function::Kind>,
662}
663/// Nested message and enum types in `Function`.
664pub mod function {
665    #[derive(prost_helpers::AnyPB)]
666    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
667    pub struct ScalarFunction {}
668    #[derive(prost_helpers::AnyPB)]
669    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
670    pub struct TableFunction {}
671    #[derive(prost_helpers::AnyPB)]
672    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
673    pub struct AggregateFunction {}
674    #[derive(prost_helpers::AnyPB)]
675    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
676    pub enum Kind {
677        #[prost(message, tag = "11")]
678        Scalar(ScalarFunction),
679        #[prost(message, tag = "12")]
680        Table(TableFunction),
681        #[prost(message, tag = "13")]
682        Aggregate(AggregateFunction),
683    }
684}
685#[derive(prost_helpers::AnyPB)]
686#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
687pub struct FlatIndexConfig {}
688#[derive(prost_helpers::AnyPB)]
689#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
690pub struct HnswFlatIndexConfig {
691    #[prost(uint32, tag = "1")]
692    pub m: u32,
693    #[prost(uint32, tag = "2")]
694    pub ef_construction: u32,
695    #[prost(uint32, tag = "3")]
696    pub max_level: u32,
697}
698#[derive(prost_helpers::AnyPB)]
699#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
700pub struct VectorIndexInfo {
701    #[prost(uint32, tag = "1")]
702    pub dimension: u32,
703    #[prost(enumeration = "super::common::DistanceType", tag = "2")]
704    pub distance_type: i32,
705    #[prost(oneof = "vector_index_info::Config", tags = "65, 66")]
706    pub config: ::core::option::Option<vector_index_info::Config>,
707}
708/// Nested message and enum types in `VectorIndexInfo`.
709pub mod vector_index_info {
710    #[derive(prost_helpers::AnyPB)]
711    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
712    pub enum Config {
713        /// reserve 64 general configs
714        #[prost(message, tag = "65")]
715        Flat(super::FlatIndexConfig),
716        #[prost(message, tag = "66")]
717        HnswFlat(super::HnswFlatIndexConfig),
718    }
719}
720/// Includes full information about a table.
721///
722/// Here `Table` is an internal concept, corresponding to *a table in storage*, all of which can be `SELECT`ed.
723/// It is not the same as a user-side table created by `CREATE TABLE`.
724///
725/// See `TableCatalog` struct in frontend crate for more information.
726#[derive(prost_helpers::AnyPB)]
727#[derive(Clone, PartialEq, ::prost::Message)]
728pub struct Table {
729    #[prost(uint32, tag = "1", wrapper = "crate::id::TableId")]
730    pub id: crate::id::TableId,
731    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
732    pub schema_id: crate::id::SchemaId,
733    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
734    pub database_id: crate::id::DatabaseId,
735    #[prost(string, tag = "4")]
736    pub name: ::prost::alloc::string::String,
737    #[prost(message, repeated, tag = "5")]
738    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
739    /// Storage-level PK. Beyond `stream_key`, it also includes order by columns.
740    #[prost(message, repeated, tag = "6")]
741    pub pk: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
742    #[prost(enumeration = "table::TableType", tag = "10")]
743    pub table_type: i32,
744    #[prost(int32, repeated, tag = "12")]
745    pub distribution_key: ::prost::alloc::vec::Vec<i32>,
746    /// pk_indices of the corresponding materialize operator's output.
747    #[prost(int32, repeated, tag = "13")]
748    pub stream_key: ::prost::alloc::vec::Vec<i32>,
749    #[prost(bool, tag = "14")]
750    pub append_only: bool,
751    #[prost(uint32, tag = "15", wrapper = "crate::id::UserId")]
752    pub owner: crate::id::UserId,
753    #[prost(uint32, tag = "17", wrapper = "crate::id::FragmentId")]
754    pub fragment_id: crate::id::FragmentId,
755    /// an optional column index which is the vnode of each row computed by the
756    /// table's consistent hash distribution
757    #[prost(uint32, optional, tag = "18")]
758    pub vnode_col_index: ::core::option::Option<u32>,
759    /// An optional column index of row id. If the primary key is specified by
760    /// users, this will be `None`.
761    #[prost(uint32, optional, tag = "19")]
762    pub row_id_index: ::core::option::Option<u32>,
763    /// The column indices which are stored in the state store's value with
764    /// row-encoding. Currently is not supported yet and expected to be
765    /// `\[0..columns.len()\]`.
766    #[prost(int32, repeated, tag = "20")]
767    pub value_indices: ::prost::alloc::vec::Vec<i32>,
768    #[prost(string, tag = "21")]
769    pub definition: ::prost::alloc::string::String,
770    /// Used to control whether handling pk conflict for incoming data.
771    #[prost(enumeration = "HandleConflictBehavior", tag = "22")]
772    pub handle_pk_conflict_behavior: i32,
773    /// Anticipated read prefix pattern (number of fields) for the table, which can
774    /// be utilized for implementing the table's SST filter or other storage
775    /// optimization techniques.
776    #[prost(uint32, tag = "23")]
777    pub read_prefix_len_hint: u32,
778    #[prost(int32, repeated, tag = "24")]
779    pub watermark_indices: ::prost::alloc::vec::Vec<i32>,
780    #[prost(int32, repeated, tag = "25")]
781    pub dist_key_in_pk: ::prost::alloc::vec::Vec<i32>,
782    /// A dml fragment id corresponds to the table, used to decide where the dml
783    /// statement is executed.
784    #[prost(uint32, optional, tag = "26", wrapper = "crate::id::FragmentId")]
785    pub dml_fragment_id: ::core::option::Option<crate::id::FragmentId>,
786    /// The range of row count of the table.
787    /// This field is not always present due to backward compatibility. Use
788    /// `Cardinality::unknown` in this case.
789    #[prost(message, optional, tag = "27")]
790    pub cardinality: ::core::option::Option<super::plan_common::Cardinality>,
791    #[prost(uint64, optional, tag = "28")]
792    pub initialized_at_epoch: ::core::option::Option<u64>,
793    #[prost(uint64, optional, tag = "29")]
794    pub created_at_epoch: ::core::option::Option<u64>,
795    /// Deprecated: reserved for compatibility with older streaming plans.
796    /// Dynamic filter used to set this, but now carries this flag in its plan node body instead.
797    #[deprecated]
798    #[prost(bool, tag = "30")]
799    pub cleaned_by_watermark: bool,
800    /// Used to filter created / creating tables in meta.
801    #[prost(enumeration = "StreamJobStatus", tag = "31")]
802    pub stream_job_status: i32,
803    #[prost(enumeration = "CreateType", tag = "32")]
804    pub create_type: i32,
805    /// This field is used to store the description set by the `comment on` clause.
806    #[prost(string, optional, tag = "33")]
807    pub description: ::core::option::Option<::prost::alloc::string::String>,
808    /// This field is used to mark the the sink into this table.
809    #[deprecated]
810    #[prost(uint32, repeated, packed = "false", tag = "34")]
811    pub incoming_sinks: ::prost::alloc::vec::Vec<u32>,
812    /// Cluster version (tracked by git commit) when initialized/created
813    #[prost(string, optional, tag = "35")]
814    pub initialized_at_cluster_version: ::core::option::Option<
815        ::prost::alloc::string::String,
816    >,
817    #[prost(string, optional, tag = "36")]
818    pub created_at_cluster_version: ::core::option::Option<
819        ::prost::alloc::string::String,
820    >,
821    /// TTL of the record in the table, to ensure the consistency with other tables
822    /// in the streaming plan, it only applies to append-only tables.
823    #[prost(uint32, optional, tag = "37")]
824    pub retention_seconds: ::core::option::Option<u32>,
825    /// This field specifies the indices of the columns set in the "with version
826    /// column" within all the columns. It is used for filtering during "on
827    /// conflict" operations. Multiple columns will be compared lexicographically.
828    #[prost(uint32, repeated, packed = "false", tag = "38")]
829    pub version_column_indices: ::prost::alloc::vec::Vec<u32>,
830    /// The unique identifier of the upstream table if it is a CDC table.
831    /// It will be used in auto schema change to get the Table which mapped to the
832    /// upstream table.
833    #[prost(string, optional, tag = "39")]
834    pub cdc_table_id: ::core::option::Option<::prost::alloc::string::String>,
835    /// Total vnode count of the table.
836    ///
837    /// Use `VnodeCountCompat::vnode_count` to access it.
838    ///
839    /// * Can be unset if the table is created in older versions where variable vnode count is not
840    ///   supported, in which case a default value of 256 (or 1 for singleton) should be used.
841    /// * Can be placeholder value `Some(0)` if the catalog is generated by the frontend and the
842    ///   corresponding job is still in `Creating` status, in which case calling `vnode_count`
843    ///   will panic.
844    ///
845    /// Please note that this field is not intended to describe the expected vnode count
846    /// for a streaming job. Instead, refer to `stream_plan.StreamFragmentGraph.max_parallelism`.
847    #[prost(uint32, optional, tag = "40")]
848    pub maybe_vnode_count: ::core::option::Option<u32>,
849    /// The information used by webhook source to validate the incoming data.
850    #[prost(message, optional, tag = "41")]
851    pub webhook_info: ::core::option::Option<WebhookSourceInfo>,
852    /// This field stores the job ID for internal tables.
853    #[prost(uint32, optional, tag = "42", wrapper = "crate::id::JobId")]
854    pub job_id: ::core::option::Option<crate::id::JobId>,
855    /// Table Engine, currently only support hummock and iceberg
856    #[prost(enumeration = "table::Engine", optional, tag = "43")]
857    pub engine: ::core::option::Option<i32>,
858    /// Indicate the index of the watermark column in the primary key that should be cleaned.
859    /// NOTICE: when it is "None", the watermark column should be the first column in the pk.
860    /// deprecated, use "clean_watermark_indices" instead. Only kept for backward compatibility.
861    #[deprecated]
862    #[prost(int32, optional, tag = "44")]
863    pub clean_watermark_index_in_pk: ::core::option::Option<i32>,
864    /// Whether the table supports manual refresh operation:
865    /// reload data from external source and emit messages based on the diff with current data.
866    #[prost(bool, tag = "45")]
867    pub refreshable: bool,
868    /// only exist when table_type is VECTOR_INDEX.
869    #[prost(message, optional, tag = "46")]
870    pub vector_index_info: ::core::option::Option<VectorIndexInfo>,
871    #[prost(enumeration = "table::CdcTableType", optional, tag = "47")]
872    pub cdc_table_type: ::core::option::Option<i32>,
873    /// Indices of watermark columns in all columns that should be used for state cleaning.
874    /// This replaces clean_watermark_index_in_pk but is kept for backward compatibility.
875    /// When set, this takes precedence over clean_watermark_index_in_pk.
876    #[prost(uint32, repeated, tag = "49")]
877    pub clean_watermark_indices: ::prost::alloc::vec::Vec<u32>,
878    /// Per-table catalog version, used by schema change. `None` for internal
879    /// tables and tests. Not to be confused with the global catalog version for
880    /// notification service.
881    #[prost(message, optional, tag = "100")]
882    pub version: ::core::option::Option<table::TableVersion>,
883    #[prost(oneof = "table::OptionalAssociatedSourceId", tags = "9")]
884    pub optional_associated_source_id: ::core::option::Option<
885        table::OptionalAssociatedSourceId,
886    >,
887}
888/// Nested message and enum types in `Table`.
889pub mod table {
890    #[derive(prost_helpers::AnyPB)]
891    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
892    pub struct TableVersion {
893        /// The version number, which will be 0 by default and be increased by 1 for
894        /// each schema change in the frontend.
895        #[prost(uint64, tag = "1")]
896        pub version: u64,
897        /// The ID of the next column to be added, which is used to make all columns
898        /// in the table have unique IDs, even if some columns have been dropped.
899        #[prost(int32, tag = "2")]
900        pub next_column_id: i32,
901    }
902    #[derive(prost_helpers::AnyPB)]
903    #[derive(
904        Clone,
905        Copy,
906        Debug,
907        PartialEq,
908        Eq,
909        Hash,
910        PartialOrd,
911        Ord,
912        ::prost::Enumeration
913    )]
914    #[repr(i32)]
915    pub enum TableType {
916        Unspecified = 0,
917        Table = 1,
918        MaterializedView = 2,
919        Index = 3,
920        Internal = 4,
921        VectorIndex = 5,
922    }
923    impl TableType {
924        /// String value of the enum field names used in the ProtoBuf definition.
925        ///
926        /// The values are not transformed in any way and thus are considered stable
927        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
928        pub fn as_str_name(&self) -> &'static str {
929            match self {
930                Self::Unspecified => "UNSPECIFIED",
931                Self::Table => "TABLE",
932                Self::MaterializedView => "MATERIALIZED_VIEW",
933                Self::Index => "INDEX",
934                Self::Internal => "INTERNAL",
935                Self::VectorIndex => "VECTOR_INDEX",
936            }
937        }
938        /// Creates an enum from field names used in the ProtoBuf definition.
939        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
940            match value {
941                "UNSPECIFIED" => Some(Self::Unspecified),
942                "TABLE" => Some(Self::Table),
943                "MATERIALIZED_VIEW" => Some(Self::MaterializedView),
944                "INDEX" => Some(Self::Index),
945                "INTERNAL" => Some(Self::Internal),
946                "VECTOR_INDEX" => Some(Self::VectorIndex),
947                _ => None,
948            }
949        }
950    }
951    #[derive(prost_helpers::AnyPB)]
952    #[derive(
953        Clone,
954        Copy,
955        Debug,
956        PartialEq,
957        Eq,
958        Hash,
959        PartialOrd,
960        Ord,
961        ::prost::Enumeration
962    )]
963    #[repr(i32)]
964    pub enum Engine {
965        Unspecified = 0,
966        Hummock = 1,
967        Iceberg = 2,
968    }
969    impl Engine {
970        /// String value of the enum field names used in the ProtoBuf definition.
971        ///
972        /// The values are not transformed in any way and thus are considered stable
973        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
974        pub fn as_str_name(&self) -> &'static str {
975            match self {
976                Self::Unspecified => "ENGINE_UNSPECIFIED",
977                Self::Hummock => "HUMMOCK",
978                Self::Iceberg => "ICEBERG",
979            }
980        }
981        /// Creates an enum from field names used in the ProtoBuf definition.
982        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
983            match value {
984                "ENGINE_UNSPECIFIED" => Some(Self::Unspecified),
985                "HUMMOCK" => Some(Self::Hummock),
986                "ICEBERG" => Some(Self::Iceberg),
987                _ => None,
988            }
989        }
990    }
991    #[derive(prost_helpers::AnyPB)]
992    #[derive(
993        Clone,
994        Copy,
995        Debug,
996        PartialEq,
997        Eq,
998        Hash,
999        PartialOrd,
1000        Ord,
1001        ::prost::Enumeration
1002    )]
1003    #[repr(i32)]
1004    pub enum CdcTableType {
1005        Unspecified = 0,
1006        Postgres = 1,
1007        Mysql = 2,
1008        SqlServer = 3,
1009        Mongodb = 4,
1010        Mariadb = 6,
1011        Oracle = 7,
1012    }
1013    impl CdcTableType {
1014        /// String value of the enum field names used in the ProtoBuf definition.
1015        ///
1016        /// The values are not transformed in any way and thus are considered stable
1017        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1018        pub fn as_str_name(&self) -> &'static str {
1019            match self {
1020                Self::Unspecified => "CDC_TABLE_TYPE_UNSPECIFIED",
1021                Self::Postgres => "CDC_TABLE_TYPE_POSTGRES",
1022                Self::Mysql => "CDC_TABLE_TYPE_MYSQL",
1023                Self::SqlServer => "CDC_TABLE_TYPE_SQL_SERVER",
1024                Self::Mongodb => "CDC_TABLE_TYPE_MONGODB",
1025                Self::Mariadb => "CDC_TABLE_TYPE_MARIADB",
1026                Self::Oracle => "CDC_TABLE_TYPE_ORACLE",
1027            }
1028        }
1029        /// Creates an enum from field names used in the ProtoBuf definition.
1030        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1031            match value {
1032                "CDC_TABLE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1033                "CDC_TABLE_TYPE_POSTGRES" => Some(Self::Postgres),
1034                "CDC_TABLE_TYPE_MYSQL" => Some(Self::Mysql),
1035                "CDC_TABLE_TYPE_SQL_SERVER" => Some(Self::SqlServer),
1036                "CDC_TABLE_TYPE_MONGODB" => Some(Self::Mongodb),
1037                "CDC_TABLE_TYPE_MARIADB" => Some(Self::Mariadb),
1038                "CDC_TABLE_TYPE_ORACLE" => Some(Self::Oracle),
1039                _ => None,
1040            }
1041        }
1042    }
1043    #[derive(prost_helpers::AnyPB)]
1044    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
1045    pub enum OptionalAssociatedSourceId {
1046        #[prost(uint32, tag = "9", wrapper = "crate::id::SourceId")]
1047        AssociatedSourceId(crate::id::SourceId),
1048    }
1049}
1050#[derive(prost_helpers::AnyPB)]
1051#[derive(Clone, PartialEq, ::prost::Message)]
1052pub struct View {
1053    #[prost(uint32, tag = "1", wrapper = "crate::id::ViewId")]
1054    pub id: crate::id::ViewId,
1055    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
1056    pub schema_id: crate::id::SchemaId,
1057    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1058    pub database_id: crate::id::DatabaseId,
1059    #[prost(string, tag = "4")]
1060    pub name: ::prost::alloc::string::String,
1061    #[prost(uint32, tag = "5", wrapper = "crate::id::UserId")]
1062    pub owner: crate::id::UserId,
1063    #[prost(btree_map = "string, string", tag = "6")]
1064    pub properties: ::prost::alloc::collections::BTreeMap<
1065        ::prost::alloc::string::String,
1066        ::prost::alloc::string::String,
1067    >,
1068    #[prost(string, tag = "7")]
1069    pub sql: ::prost::alloc::string::String,
1070    /// User-specified column names.
1071    #[prost(message, repeated, tag = "9")]
1072    pub columns: ::prost::alloc::vec::Vec<super::plan_common::Field>,
1073    #[prost(uint64, optional, tag = "10")]
1074    pub created_at_epoch: ::core::option::Option<u64>,
1075    #[prost(string, optional, tag = "11")]
1076    pub created_at_cluster_version: ::core::option::Option<
1077        ::prost::alloc::string::String,
1078    >,
1079}
1080#[derive(prost_helpers::AnyPB)]
1081#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1082pub struct Schema {
1083    #[prost(uint32, tag = "1", wrapper = "crate::id::SchemaId")]
1084    pub id: crate::id::SchemaId,
1085    #[prost(uint32, tag = "2", wrapper = "crate::id::DatabaseId")]
1086    pub database_id: crate::id::DatabaseId,
1087    #[prost(string, tag = "3")]
1088    pub name: ::prost::alloc::string::String,
1089    #[prost(uint32, tag = "4", wrapper = "crate::id::UserId")]
1090    pub owner: crate::id::UserId,
1091}
1092#[derive(prost_helpers::AnyPB)]
1093#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1094pub struct Database {
1095    #[prost(uint32, tag = "1", wrapper = "crate::id::DatabaseId")]
1096    pub id: crate::id::DatabaseId,
1097    #[prost(string, tag = "2")]
1098    pub name: ::prost::alloc::string::String,
1099    #[prost(uint32, tag = "3", wrapper = "crate::id::UserId")]
1100    pub owner: crate::id::UserId,
1101    #[prost(string, tag = "4")]
1102    pub resource_group: ::prost::alloc::string::String,
1103    #[prost(uint32, optional, tag = "5")]
1104    pub barrier_interval_ms: ::core::option::Option<u32>,
1105    #[prost(uint64, optional, tag = "6")]
1106    pub checkpoint_frequency: ::core::option::Option<u64>,
1107}
1108#[derive(prost_helpers::AnyPB)]
1109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1110pub struct Comment {
1111    #[prost(uint32, tag = "1", wrapper = "crate::id::TableId")]
1112    pub table_id: crate::id::TableId,
1113    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
1114    pub schema_id: crate::id::SchemaId,
1115    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1116    pub database_id: crate::id::DatabaseId,
1117    #[prost(uint32, optional, tag = "4")]
1118    pub column_index: ::core::option::Option<u32>,
1119    #[prost(string, optional, tag = "5")]
1120    pub description: ::core::option::Option<::prost::alloc::string::String>,
1121}
1122#[derive(prost_helpers::AnyPB)]
1123#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1124pub struct Secret {
1125    #[prost(uint32, tag = "1", wrapper = "crate::id::SecretId")]
1126    pub id: crate::id::SecretId,
1127    #[prost(string, tag = "2")]
1128    pub name: ::prost::alloc::string::String,
1129    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1130    pub database_id: crate::id::DatabaseId,
1131    /// The secret here is encrypted to bytes.
1132    #[prost(bytes = "vec", tag = "4")]
1133    pub value: ::prost::alloc::vec::Vec<u8>,
1134    #[prost(uint32, tag = "5", wrapper = "crate::id::UserId")]
1135    pub owner: crate::id::UserId,
1136    #[prost(uint32, tag = "6", wrapper = "crate::id::SchemaId")]
1137    pub schema_id: crate::id::SchemaId,
1138}
1139#[derive(prost_helpers::AnyPB)]
1140#[derive(Clone, PartialEq, ::prost::Message)]
1141pub struct OptionsWithSecret {
1142    #[prost(map = "string, string", tag = "1")]
1143    pub options: ::std::collections::HashMap<
1144        ::prost::alloc::string::String,
1145        ::prost::alloc::string::String,
1146    >,
1147    #[prost(map = "string, message", tag = "2")]
1148    pub secret_refs: ::std::collections::HashMap<
1149        ::prost::alloc::string::String,
1150        super::secret::SecretRef,
1151    >,
1152}
1153#[derive(prost_helpers::AnyPB)]
1154#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1155#[repr(i32)]
1156pub enum SchemaRegistryNameStrategy {
1157    Unspecified = 0,
1158    RecordNameStrategy = 1,
1159    TopicRecordNameStrategy = 2,
1160}
1161impl SchemaRegistryNameStrategy {
1162    /// String value of the enum field names used in the ProtoBuf definition.
1163    ///
1164    /// The values are not transformed in any way and thus are considered stable
1165    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1166    pub fn as_str_name(&self) -> &'static str {
1167        match self {
1168            Self::Unspecified => "SCHEMA_REGISTRY_NAME_STRATEGY_UNSPECIFIED",
1169            Self::RecordNameStrategy => {
1170                "SCHEMA_REGISTRY_NAME_STRATEGY_RECORD_NAME_STRATEGY"
1171            }
1172            Self::TopicRecordNameStrategy => {
1173                "SCHEMA_REGISTRY_NAME_STRATEGY_TOPIC_RECORD_NAME_STRATEGY"
1174            }
1175        }
1176    }
1177    /// Creates an enum from field names used in the ProtoBuf definition.
1178    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1179        match value {
1180            "SCHEMA_REGISTRY_NAME_STRATEGY_UNSPECIFIED" => Some(Self::Unspecified),
1181            "SCHEMA_REGISTRY_NAME_STRATEGY_RECORD_NAME_STRATEGY" => {
1182                Some(Self::RecordNameStrategy)
1183            }
1184            "SCHEMA_REGISTRY_NAME_STRATEGY_TOPIC_RECORD_NAME_STRATEGY" => {
1185                Some(Self::TopicRecordNameStrategy)
1186            }
1187            _ => None,
1188        }
1189    }
1190}
1191#[derive(prost_helpers::AnyPB)]
1192#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1193#[repr(i32)]
1194pub enum StreamJobStatus {
1195    /// Prefixed by `STREAM_JOB_STATUS` due to protobuf namespacing rules.
1196    Unspecified = 0,
1197    Creating = 1,
1198    Created = 2,
1199}
1200impl StreamJobStatus {
1201    /// String value of the enum field names used in the ProtoBuf definition.
1202    ///
1203    /// The values are not transformed in any way and thus are considered stable
1204    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1205    pub fn as_str_name(&self) -> &'static str {
1206        match self {
1207            Self::Unspecified => "STREAM_JOB_STATUS_UNSPECIFIED",
1208            Self::Creating => "STREAM_JOB_STATUS_CREATING",
1209            Self::Created => "STREAM_JOB_STATUS_CREATED",
1210        }
1211    }
1212    /// Creates an enum from field names used in the ProtoBuf definition.
1213    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1214        match value {
1215            "STREAM_JOB_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
1216            "STREAM_JOB_STATUS_CREATING" => Some(Self::Creating),
1217            "STREAM_JOB_STATUS_CREATED" => Some(Self::Created),
1218            _ => None,
1219        }
1220    }
1221}
1222/// How the stream job was created will determine
1223/// whether they are persisted.
1224#[derive(prost_helpers::AnyPB)]
1225#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1226#[repr(i32)]
1227pub enum CreateType {
1228    Unspecified = 0,
1229    Background = 1,
1230    Foreground = 2,
1231}
1232impl CreateType {
1233    /// String value of the enum field names used in the ProtoBuf definition.
1234    ///
1235    /// The values are not transformed in any way and thus are considered stable
1236    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1237    pub fn as_str_name(&self) -> &'static str {
1238        match self {
1239            Self::Unspecified => "CREATE_TYPE_UNSPECIFIED",
1240            Self::Background => "CREATE_TYPE_BACKGROUND",
1241            Self::Foreground => "CREATE_TYPE_FOREGROUND",
1242        }
1243    }
1244    /// Creates an enum from field names used in the ProtoBuf definition.
1245    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1246        match value {
1247            "CREATE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1248            "CREATE_TYPE_BACKGROUND" => Some(Self::Background),
1249            "CREATE_TYPE_FOREGROUND" => Some(Self::Foreground),
1250            _ => None,
1251        }
1252    }
1253}
1254#[derive(prost_helpers::AnyPB)]
1255#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1256#[repr(i32)]
1257pub enum SinkType {
1258    Unspecified = 0,
1259    AppendOnly = 1,
1260    /// Deprecated. Use `append_only` + `ignore_delete` instead.
1261    #[deprecated]
1262    ForceAppendOnly = 2,
1263    Upsert = 3,
1264    Retract = 4,
1265}
1266impl SinkType {
1267    /// String value of the enum field names used in the ProtoBuf definition.
1268    ///
1269    /// The values are not transformed in any way and thus are considered stable
1270    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1271    pub fn as_str_name(&self) -> &'static str {
1272        match self {
1273            Self::Unspecified => "SINK_TYPE_UNSPECIFIED",
1274            Self::AppendOnly => "SINK_TYPE_APPEND_ONLY",
1275            #[allow(deprecated)]
1276            Self::ForceAppendOnly => "SINK_TYPE_FORCE_APPEND_ONLY",
1277            Self::Upsert => "SINK_TYPE_UPSERT",
1278            Self::Retract => "SINK_TYPE_RETRACT",
1279        }
1280    }
1281    /// Creates an enum from field names used in the ProtoBuf definition.
1282    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1283        match value {
1284            "SINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1285            "SINK_TYPE_APPEND_ONLY" => Some(Self::AppendOnly),
1286            "SINK_TYPE_FORCE_APPEND_ONLY" => {
1287                Some(#[allow(deprecated)] Self::ForceAppendOnly)
1288            }
1289            "SINK_TYPE_UPSERT" => Some(Self::Upsert),
1290            "SINK_TYPE_RETRACT" => Some(Self::Retract),
1291            _ => None,
1292        }
1293    }
1294}
1295#[derive(prost_helpers::AnyPB)]
1296#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1297#[repr(i32)]
1298pub enum HandleConflictBehavior {
1299    Unspecified = 0,
1300    Overwrite = 1,
1301    Ignore = 2,
1302    NoCheck = 3,
1303    DoUpdateIfNotNull = 4,
1304}
1305impl HandleConflictBehavior {
1306    /// String value of the enum field names used in the ProtoBuf definition.
1307    ///
1308    /// The values are not transformed in any way and thus are considered stable
1309    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1310    pub fn as_str_name(&self) -> &'static str {
1311        match self {
1312            Self::Unspecified => "HANDLE_CONFLICT_BEHAVIOR_UNSPECIFIED",
1313            Self::Overwrite => "HANDLE_CONFLICT_BEHAVIOR_OVERWRITE",
1314            Self::Ignore => "HANDLE_CONFLICT_BEHAVIOR_IGNORE",
1315            Self::NoCheck => "HANDLE_CONFLICT_BEHAVIOR_NO_CHECK",
1316            Self::DoUpdateIfNotNull => "HANDLE_CONFLICT_BEHAVIOR_DO_UPDATE_IF_NOT_NULL",
1317        }
1318    }
1319    /// Creates an enum from field names used in the ProtoBuf definition.
1320    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1321        match value {
1322            "HANDLE_CONFLICT_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
1323            "HANDLE_CONFLICT_BEHAVIOR_OVERWRITE" => Some(Self::Overwrite),
1324            "HANDLE_CONFLICT_BEHAVIOR_IGNORE" => Some(Self::Ignore),
1325            "HANDLE_CONFLICT_BEHAVIOR_NO_CHECK" => Some(Self::NoCheck),
1326            "HANDLE_CONFLICT_BEHAVIOR_DO_UPDATE_IF_NOT_NULL" => {
1327                Some(Self::DoUpdateIfNotNull)
1328            }
1329            _ => None,
1330        }
1331    }
1332}
1333/// State of refresh operation for refreshable tables
1334#[derive(prost_helpers::AnyPB)]
1335#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1336#[repr(i32)]
1337pub enum RefreshState {
1338    Unspecified = 0,
1339    Idle = 1,
1340    Refreshing = 2,
1341    Finishing = 3,
1342}
1343impl RefreshState {
1344    /// String value of the enum field names used in the ProtoBuf definition.
1345    ///
1346    /// The values are not transformed in any way and thus are considered stable
1347    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1348    pub fn as_str_name(&self) -> &'static str {
1349        match self {
1350            Self::Unspecified => "REFRESH_STATE_UNSPECIFIED",
1351            Self::Idle => "REFRESH_STATE_IDLE",
1352            Self::Refreshing => "REFRESH_STATE_REFRESHING",
1353            Self::Finishing => "REFRESH_STATE_FINISHING",
1354        }
1355    }
1356    /// Creates an enum from field names used in the ProtoBuf definition.
1357    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1358        match value {
1359            "REFRESH_STATE_UNSPECIFIED" => Some(Self::Unspecified),
1360            "REFRESH_STATE_IDLE" => Some(Self::Idle),
1361            "REFRESH_STATE_REFRESHING" => Some(Self::Refreshing),
1362            "REFRESH_STATE_FINISHING" => Some(Self::Finishing),
1363            _ => None,
1364        }
1365    }
1366}