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    /// Source refresh mode
177    #[prost(message, optional, tag = "20")]
178    pub refresh_mode: ::core::option::Option<super::plan_common::SourceRefreshMode>,
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    #[prost(oneof = "function::Kind", tags = "11, 12, 13")]
650    pub kind: ::core::option::Option<function::Kind>,
651}
652/// Nested message and enum types in `Function`.
653pub mod function {
654    #[derive(prost_helpers::AnyPB)]
655    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
656    pub struct ScalarFunction {}
657    #[derive(prost_helpers::AnyPB)]
658    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
659    pub struct TableFunction {}
660    #[derive(prost_helpers::AnyPB)]
661    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
662    pub struct AggregateFunction {}
663    #[derive(prost_helpers::AnyPB)]
664    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
665    pub enum Kind {
666        #[prost(message, tag = "11")]
667        Scalar(ScalarFunction),
668        #[prost(message, tag = "12")]
669        Table(TableFunction),
670        #[prost(message, tag = "13")]
671        Aggregate(AggregateFunction),
672    }
673}
674#[derive(prost_helpers::AnyPB)]
675#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
676pub struct FlatIndexConfig {}
677#[derive(prost_helpers::AnyPB)]
678#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
679pub struct HnswFlatIndexConfig {
680    #[prost(uint32, tag = "1")]
681    pub m: u32,
682    #[prost(uint32, tag = "2")]
683    pub ef_construction: u32,
684    #[prost(uint32, tag = "3")]
685    pub max_level: u32,
686}
687#[derive(prost_helpers::AnyPB)]
688#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
689pub struct VectorIndexInfo {
690    #[prost(uint32, tag = "1")]
691    pub dimension: u32,
692    #[prost(enumeration = "super::common::DistanceType", tag = "2")]
693    pub distance_type: i32,
694    #[prost(oneof = "vector_index_info::Config", tags = "65, 66")]
695    pub config: ::core::option::Option<vector_index_info::Config>,
696}
697/// Nested message and enum types in `VectorIndexInfo`.
698pub mod vector_index_info {
699    #[derive(prost_helpers::AnyPB)]
700    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
701    pub enum Config {
702        /// reserve 64 general configs
703        #[prost(message, tag = "65")]
704        Flat(super::FlatIndexConfig),
705        #[prost(message, tag = "66")]
706        HnswFlat(super::HnswFlatIndexConfig),
707    }
708}
709/// Includes full information about a table.
710///
711/// Here `Table` is an internal concept, corresponding to *a table in storage*, all of which can be `SELECT`ed.
712/// It is not the same as a user-side table created by `CREATE TABLE`.
713///
714/// See `TableCatalog` struct in frontend crate for more information.
715#[derive(prost_helpers::AnyPB)]
716#[derive(Clone, PartialEq, ::prost::Message)]
717pub struct Table {
718    #[prost(uint32, tag = "1", wrapper = "crate::id::TableId")]
719    pub id: crate::id::TableId,
720    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
721    pub schema_id: crate::id::SchemaId,
722    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
723    pub database_id: crate::id::DatabaseId,
724    #[prost(string, tag = "4")]
725    pub name: ::prost::alloc::string::String,
726    #[prost(message, repeated, tag = "5")]
727    pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnCatalog>,
728    /// Storage-level PK. Beyond `stream_key`, it also includes order by columns.
729    #[prost(message, repeated, tag = "6")]
730    pub pk: ::prost::alloc::vec::Vec<super::common::ColumnOrder>,
731    #[prost(enumeration = "table::TableType", tag = "10")]
732    pub table_type: i32,
733    #[prost(int32, repeated, tag = "12")]
734    pub distribution_key: ::prost::alloc::vec::Vec<i32>,
735    /// pk_indices of the corresponding materialize operator's output.
736    #[prost(int32, repeated, tag = "13")]
737    pub stream_key: ::prost::alloc::vec::Vec<i32>,
738    #[prost(bool, tag = "14")]
739    pub append_only: bool,
740    #[prost(uint32, tag = "15", wrapper = "crate::id::UserId")]
741    pub owner: crate::id::UserId,
742    #[prost(uint32, tag = "17", wrapper = "crate::id::FragmentId")]
743    pub fragment_id: crate::id::FragmentId,
744    /// an optional column index which is the vnode of each row computed by the
745    /// table's consistent hash distribution
746    #[prost(uint32, optional, tag = "18")]
747    pub vnode_col_index: ::core::option::Option<u32>,
748    /// An optional column index of row id. If the primary key is specified by
749    /// users, this will be `None`.
750    #[prost(uint32, optional, tag = "19")]
751    pub row_id_index: ::core::option::Option<u32>,
752    /// The column indices which are stored in the state store's value with
753    /// row-encoding. Currently is not supported yet and expected to be
754    /// `\[0..columns.len()\]`.
755    #[prost(int32, repeated, tag = "20")]
756    pub value_indices: ::prost::alloc::vec::Vec<i32>,
757    #[prost(string, tag = "21")]
758    pub definition: ::prost::alloc::string::String,
759    /// Used to control whether handling pk conflict for incoming data.
760    #[prost(enumeration = "HandleConflictBehavior", tag = "22")]
761    pub handle_pk_conflict_behavior: i32,
762    /// Anticipated read prefix pattern (number of fields) for the table, which can
763    /// be utilized for implementing the table's bloom filter or other storage
764    /// optimization techniques.
765    #[prost(uint32, tag = "23")]
766    pub read_prefix_len_hint: u32,
767    #[prost(int32, repeated, tag = "24")]
768    pub watermark_indices: ::prost::alloc::vec::Vec<i32>,
769    #[prost(int32, repeated, tag = "25")]
770    pub dist_key_in_pk: ::prost::alloc::vec::Vec<i32>,
771    /// A dml fragment id corresponds to the table, used to decide where the dml
772    /// statement is executed.
773    #[prost(uint32, optional, tag = "26", wrapper = "crate::id::FragmentId")]
774    pub dml_fragment_id: ::core::option::Option<crate::id::FragmentId>,
775    /// The range of row count of the table.
776    /// This field is not always present due to backward compatibility. Use
777    /// `Cardinality::unknown` in this case.
778    #[prost(message, optional, tag = "27")]
779    pub cardinality: ::core::option::Option<super::plan_common::Cardinality>,
780    #[prost(uint64, optional, tag = "28")]
781    pub initialized_at_epoch: ::core::option::Option<u64>,
782    #[prost(uint64, optional, tag = "29")]
783    pub created_at_epoch: ::core::option::Option<u64>,
784    /// Deprecated: reserved for compatibility with older streaming plans.
785    /// Dynamic filter used to set this, but now carries this flag in its plan node body instead.
786    #[deprecated]
787    #[prost(bool, tag = "30")]
788    pub cleaned_by_watermark: bool,
789    /// Used to filter created / creating tables in meta.
790    #[prost(enumeration = "StreamJobStatus", tag = "31")]
791    pub stream_job_status: i32,
792    #[prost(enumeration = "CreateType", tag = "32")]
793    pub create_type: i32,
794    /// This field is used to store the description set by the `comment on` clause.
795    #[prost(string, optional, tag = "33")]
796    pub description: ::core::option::Option<::prost::alloc::string::String>,
797    /// This field is used to mark the the sink into this table.
798    #[deprecated]
799    #[prost(uint32, repeated, packed = "false", tag = "34")]
800    pub incoming_sinks: ::prost::alloc::vec::Vec<u32>,
801    /// Cluster version (tracked by git commit) when initialized/created
802    #[prost(string, optional, tag = "35")]
803    pub initialized_at_cluster_version: ::core::option::Option<
804        ::prost::alloc::string::String,
805    >,
806    #[prost(string, optional, tag = "36")]
807    pub created_at_cluster_version: ::core::option::Option<
808        ::prost::alloc::string::String,
809    >,
810    /// TTL of the record in the table, to ensure the consistency with other tables
811    /// in the streaming plan, it only applies to append-only tables.
812    #[prost(uint32, optional, tag = "37")]
813    pub retention_seconds: ::core::option::Option<u32>,
814    /// This field specifies the indices of the columns set in the "with version
815    /// column" within all the columns. It is used for filtering during "on
816    /// conflict" operations. Multiple columns will be compared lexicographically.
817    #[prost(uint32, repeated, packed = "false", tag = "38")]
818    pub version_column_indices: ::prost::alloc::vec::Vec<u32>,
819    /// The unique identifier of the upstream table if it is a CDC table.
820    /// It will be used in auto schema change to get the Table which mapped to the
821    /// upstream table.
822    #[prost(string, optional, tag = "39")]
823    pub cdc_table_id: ::core::option::Option<::prost::alloc::string::String>,
824    /// Total vnode count of the table.
825    ///
826    /// Use `VnodeCountCompat::vnode_count` to access it.
827    ///
828    /// * Can be unset if the table is created in older versions where variable vnode count is not
829    ///   supported, in which case a default value of 256 (or 1 for singleton) should be used.
830    /// * Can be placeholder value `Some(0)` if the catalog is generated by the frontend and the
831    ///   corresponding job is still in `Creating` status, in which case calling `vnode_count`
832    ///   will panic.
833    ///
834    /// Please note that this field is not intended to describe the expected vnode count
835    /// for a streaming job. Instead, refer to `stream_plan.StreamFragmentGraph.max_parallelism`.
836    #[prost(uint32, optional, tag = "40")]
837    pub maybe_vnode_count: ::core::option::Option<u32>,
838    /// The information used by webhook source to validate the incoming data.
839    #[prost(message, optional, tag = "41")]
840    pub webhook_info: ::core::option::Option<WebhookSourceInfo>,
841    /// This field stores the job ID for internal tables.
842    #[prost(uint32, optional, tag = "42", wrapper = "crate::id::JobId")]
843    pub job_id: ::core::option::Option<crate::id::JobId>,
844    /// Table Engine, currently only support hummock and iceberg
845    #[prost(enumeration = "table::Engine", optional, tag = "43")]
846    pub engine: ::core::option::Option<i32>,
847    /// Indicate the index of the watermark column in the primary key that should be cleaned.
848    /// NOTICE: when it is "None", the watermark column should be the first column in the pk.
849    /// deprecated, use "clean_watermark_indices" instead. Only kept for backward compatibility.
850    #[deprecated]
851    #[prost(int32, optional, tag = "44")]
852    pub clean_watermark_index_in_pk: ::core::option::Option<i32>,
853    /// Whether the table supports manual refresh operation:
854    /// reload data from external source and emit messages based on the diff with current data.
855    #[prost(bool, tag = "45")]
856    pub refreshable: bool,
857    /// only exist when table_type is VECTOR_INDEX.
858    #[prost(message, optional, tag = "46")]
859    pub vector_index_info: ::core::option::Option<VectorIndexInfo>,
860    #[prost(enumeration = "table::CdcTableType", optional, tag = "47")]
861    pub cdc_table_type: ::core::option::Option<i32>,
862    /// Indices of watermark columns in all columns that should be used for state cleaning.
863    /// This replaces clean_watermark_index_in_pk but is kept for backward compatibility.
864    /// When set, this takes precedence over clean_watermark_index_in_pk.
865    #[prost(uint32, repeated, tag = "49")]
866    pub clean_watermark_indices: ::prost::alloc::vec::Vec<u32>,
867    /// Per-table catalog version, used by schema change. `None` for internal
868    /// tables and tests. Not to be confused with the global catalog version for
869    /// notification service.
870    #[prost(message, optional, tag = "100")]
871    pub version: ::core::option::Option<table::TableVersion>,
872    #[prost(oneof = "table::OptionalAssociatedSourceId", tags = "9")]
873    pub optional_associated_source_id: ::core::option::Option<
874        table::OptionalAssociatedSourceId,
875    >,
876}
877/// Nested message and enum types in `Table`.
878pub mod table {
879    #[derive(prost_helpers::AnyPB)]
880    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
881    pub struct TableVersion {
882        /// The version number, which will be 0 by default and be increased by 1 for
883        /// each schema change in the frontend.
884        #[prost(uint64, tag = "1")]
885        pub version: u64,
886        /// The ID of the next column to be added, which is used to make all columns
887        /// in the table have unique IDs, even if some columns have been dropped.
888        #[prost(int32, tag = "2")]
889        pub next_column_id: i32,
890    }
891    #[derive(prost_helpers::AnyPB)]
892    #[derive(
893        Clone,
894        Copy,
895        Debug,
896        PartialEq,
897        Eq,
898        Hash,
899        PartialOrd,
900        Ord,
901        ::prost::Enumeration
902    )]
903    #[repr(i32)]
904    pub enum TableType {
905        Unspecified = 0,
906        Table = 1,
907        MaterializedView = 2,
908        Index = 3,
909        Internal = 4,
910        VectorIndex = 5,
911    }
912    impl TableType {
913        /// String value of the enum field names used in the ProtoBuf definition.
914        ///
915        /// The values are not transformed in any way and thus are considered stable
916        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
917        pub fn as_str_name(&self) -> &'static str {
918            match self {
919                Self::Unspecified => "UNSPECIFIED",
920                Self::Table => "TABLE",
921                Self::MaterializedView => "MATERIALIZED_VIEW",
922                Self::Index => "INDEX",
923                Self::Internal => "INTERNAL",
924                Self::VectorIndex => "VECTOR_INDEX",
925            }
926        }
927        /// Creates an enum from field names used in the ProtoBuf definition.
928        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
929            match value {
930                "UNSPECIFIED" => Some(Self::Unspecified),
931                "TABLE" => Some(Self::Table),
932                "MATERIALIZED_VIEW" => Some(Self::MaterializedView),
933                "INDEX" => Some(Self::Index),
934                "INTERNAL" => Some(Self::Internal),
935                "VECTOR_INDEX" => Some(Self::VectorIndex),
936                _ => None,
937            }
938        }
939    }
940    #[derive(prost_helpers::AnyPB)]
941    #[derive(
942        Clone,
943        Copy,
944        Debug,
945        PartialEq,
946        Eq,
947        Hash,
948        PartialOrd,
949        Ord,
950        ::prost::Enumeration
951    )]
952    #[repr(i32)]
953    pub enum Engine {
954        Unspecified = 0,
955        Hummock = 1,
956        Iceberg = 2,
957    }
958    impl Engine {
959        /// String value of the enum field names used in the ProtoBuf definition.
960        ///
961        /// The values are not transformed in any way and thus are considered stable
962        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
963        pub fn as_str_name(&self) -> &'static str {
964            match self {
965                Self::Unspecified => "ENGINE_UNSPECIFIED",
966                Self::Hummock => "HUMMOCK",
967                Self::Iceberg => "ICEBERG",
968            }
969        }
970        /// Creates an enum from field names used in the ProtoBuf definition.
971        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
972            match value {
973                "ENGINE_UNSPECIFIED" => Some(Self::Unspecified),
974                "HUMMOCK" => Some(Self::Hummock),
975                "ICEBERG" => Some(Self::Iceberg),
976                _ => None,
977            }
978        }
979    }
980    #[derive(prost_helpers::AnyPB)]
981    #[derive(
982        Clone,
983        Copy,
984        Debug,
985        PartialEq,
986        Eq,
987        Hash,
988        PartialOrd,
989        Ord,
990        ::prost::Enumeration
991    )]
992    #[repr(i32)]
993    pub enum CdcTableType {
994        Unspecified = 0,
995        Postgres = 1,
996        Mysql = 2,
997        Sqlserver = 3,
998        Mongo = 4,
999        Citus = 5,
1000    }
1001    impl CdcTableType {
1002        /// String value of the enum field names used in the ProtoBuf definition.
1003        ///
1004        /// The values are not transformed in any way and thus are considered stable
1005        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1006        pub fn as_str_name(&self) -> &'static str {
1007            match self {
1008                Self::Unspecified => "CDC_TABLE_TYPE_UNSPECIFIED",
1009                Self::Postgres => "CDC_TABLE_TYPE_POSTGRES",
1010                Self::Mysql => "CDC_TABLE_TYPE_MYSQL",
1011                Self::Sqlserver => "CDC_TABLE_TYPE_SQLSERVER",
1012                Self::Mongo => "CDC_TABLE_TYPE_MONGO",
1013                Self::Citus => "CDC_TABLE_TYPE_CITUS",
1014            }
1015        }
1016        /// Creates an enum from field names used in the ProtoBuf definition.
1017        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1018            match value {
1019                "CDC_TABLE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1020                "CDC_TABLE_TYPE_POSTGRES" => Some(Self::Postgres),
1021                "CDC_TABLE_TYPE_MYSQL" => Some(Self::Mysql),
1022                "CDC_TABLE_TYPE_SQLSERVER" => Some(Self::Sqlserver),
1023                "CDC_TABLE_TYPE_MONGO" => Some(Self::Mongo),
1024                "CDC_TABLE_TYPE_CITUS" => Some(Self::Citus),
1025                _ => None,
1026            }
1027        }
1028    }
1029    #[derive(prost_helpers::AnyPB)]
1030    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
1031    pub enum OptionalAssociatedSourceId {
1032        #[prost(uint32, tag = "9", wrapper = "crate::id::SourceId")]
1033        AssociatedSourceId(crate::id::SourceId),
1034    }
1035}
1036#[derive(prost_helpers::AnyPB)]
1037#[derive(Clone, PartialEq, ::prost::Message)]
1038pub struct View {
1039    #[prost(uint32, tag = "1", wrapper = "crate::id::ViewId")]
1040    pub id: crate::id::ViewId,
1041    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
1042    pub schema_id: crate::id::SchemaId,
1043    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1044    pub database_id: crate::id::DatabaseId,
1045    #[prost(string, tag = "4")]
1046    pub name: ::prost::alloc::string::String,
1047    #[prost(uint32, tag = "5", wrapper = "crate::id::UserId")]
1048    pub owner: crate::id::UserId,
1049    #[prost(btree_map = "string, string", tag = "6")]
1050    pub properties: ::prost::alloc::collections::BTreeMap<
1051        ::prost::alloc::string::String,
1052        ::prost::alloc::string::String,
1053    >,
1054    #[prost(string, tag = "7")]
1055    pub sql: ::prost::alloc::string::String,
1056    /// User-specified column names.
1057    #[prost(message, repeated, tag = "9")]
1058    pub columns: ::prost::alloc::vec::Vec<super::plan_common::Field>,
1059    #[prost(uint64, optional, tag = "10")]
1060    pub created_at_epoch: ::core::option::Option<u64>,
1061    #[prost(string, optional, tag = "11")]
1062    pub created_at_cluster_version: ::core::option::Option<
1063        ::prost::alloc::string::String,
1064    >,
1065}
1066#[derive(prost_helpers::AnyPB)]
1067#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1068pub struct Schema {
1069    #[prost(uint32, tag = "1", wrapper = "crate::id::SchemaId")]
1070    pub id: crate::id::SchemaId,
1071    #[prost(uint32, tag = "2", wrapper = "crate::id::DatabaseId")]
1072    pub database_id: crate::id::DatabaseId,
1073    #[prost(string, tag = "3")]
1074    pub name: ::prost::alloc::string::String,
1075    #[prost(uint32, tag = "4", wrapper = "crate::id::UserId")]
1076    pub owner: crate::id::UserId,
1077}
1078#[derive(prost_helpers::AnyPB)]
1079#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1080pub struct Database {
1081    #[prost(uint32, tag = "1", wrapper = "crate::id::DatabaseId")]
1082    pub id: crate::id::DatabaseId,
1083    #[prost(string, tag = "2")]
1084    pub name: ::prost::alloc::string::String,
1085    #[prost(uint32, tag = "3", wrapper = "crate::id::UserId")]
1086    pub owner: crate::id::UserId,
1087    #[prost(string, tag = "4")]
1088    pub resource_group: ::prost::alloc::string::String,
1089    #[prost(uint32, optional, tag = "5")]
1090    pub barrier_interval_ms: ::core::option::Option<u32>,
1091    #[prost(uint64, optional, tag = "6")]
1092    pub checkpoint_frequency: ::core::option::Option<u64>,
1093}
1094#[derive(prost_helpers::AnyPB)]
1095#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1096pub struct Comment {
1097    #[prost(uint32, tag = "1", wrapper = "crate::id::TableId")]
1098    pub table_id: crate::id::TableId,
1099    #[prost(uint32, tag = "2", wrapper = "crate::id::SchemaId")]
1100    pub schema_id: crate::id::SchemaId,
1101    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1102    pub database_id: crate::id::DatabaseId,
1103    #[prost(uint32, optional, tag = "4")]
1104    pub column_index: ::core::option::Option<u32>,
1105    #[prost(string, optional, tag = "5")]
1106    pub description: ::core::option::Option<::prost::alloc::string::String>,
1107}
1108#[derive(prost_helpers::AnyPB)]
1109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1110pub struct Secret {
1111    #[prost(uint32, tag = "1", wrapper = "crate::id::SecretId")]
1112    pub id: crate::id::SecretId,
1113    #[prost(string, tag = "2")]
1114    pub name: ::prost::alloc::string::String,
1115    #[prost(uint32, tag = "3", wrapper = "crate::id::DatabaseId")]
1116    pub database_id: crate::id::DatabaseId,
1117    /// The secret here is encrypted to bytes.
1118    #[prost(bytes = "vec", tag = "4")]
1119    pub value: ::prost::alloc::vec::Vec<u8>,
1120    #[prost(uint32, tag = "5", wrapper = "crate::id::UserId")]
1121    pub owner: crate::id::UserId,
1122    #[prost(uint32, tag = "6", wrapper = "crate::id::SchemaId")]
1123    pub schema_id: crate::id::SchemaId,
1124}
1125#[derive(prost_helpers::AnyPB)]
1126#[derive(Clone, PartialEq, ::prost::Message)]
1127pub struct OptionsWithSecret {
1128    #[prost(map = "string, string", tag = "1")]
1129    pub options: ::std::collections::HashMap<
1130        ::prost::alloc::string::String,
1131        ::prost::alloc::string::String,
1132    >,
1133    #[prost(map = "string, message", tag = "2")]
1134    pub secret_refs: ::std::collections::HashMap<
1135        ::prost::alloc::string::String,
1136        super::secret::SecretRef,
1137    >,
1138}
1139#[derive(prost_helpers::AnyPB)]
1140#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1141#[repr(i32)]
1142pub enum SchemaRegistryNameStrategy {
1143    Unspecified = 0,
1144    RecordNameStrategy = 1,
1145    TopicRecordNameStrategy = 2,
1146}
1147impl SchemaRegistryNameStrategy {
1148    /// String value of the enum field names used in the ProtoBuf definition.
1149    ///
1150    /// The values are not transformed in any way and thus are considered stable
1151    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1152    pub fn as_str_name(&self) -> &'static str {
1153        match self {
1154            Self::Unspecified => "SCHEMA_REGISTRY_NAME_STRATEGY_UNSPECIFIED",
1155            Self::RecordNameStrategy => {
1156                "SCHEMA_REGISTRY_NAME_STRATEGY_RECORD_NAME_STRATEGY"
1157            }
1158            Self::TopicRecordNameStrategy => {
1159                "SCHEMA_REGISTRY_NAME_STRATEGY_TOPIC_RECORD_NAME_STRATEGY"
1160            }
1161        }
1162    }
1163    /// Creates an enum from field names used in the ProtoBuf definition.
1164    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1165        match value {
1166            "SCHEMA_REGISTRY_NAME_STRATEGY_UNSPECIFIED" => Some(Self::Unspecified),
1167            "SCHEMA_REGISTRY_NAME_STRATEGY_RECORD_NAME_STRATEGY" => {
1168                Some(Self::RecordNameStrategy)
1169            }
1170            "SCHEMA_REGISTRY_NAME_STRATEGY_TOPIC_RECORD_NAME_STRATEGY" => {
1171                Some(Self::TopicRecordNameStrategy)
1172            }
1173            _ => None,
1174        }
1175    }
1176}
1177#[derive(prost_helpers::AnyPB)]
1178#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1179#[repr(i32)]
1180pub enum StreamJobStatus {
1181    /// Prefixed by `STREAM_JOB_STATUS` due to protobuf namespacing rules.
1182    Unspecified = 0,
1183    Creating = 1,
1184    Created = 2,
1185}
1186impl StreamJobStatus {
1187    /// String value of the enum field names used in the ProtoBuf definition.
1188    ///
1189    /// The values are not transformed in any way and thus are considered stable
1190    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1191    pub fn as_str_name(&self) -> &'static str {
1192        match self {
1193            Self::Unspecified => "STREAM_JOB_STATUS_UNSPECIFIED",
1194            Self::Creating => "STREAM_JOB_STATUS_CREATING",
1195            Self::Created => "STREAM_JOB_STATUS_CREATED",
1196        }
1197    }
1198    /// Creates an enum from field names used in the ProtoBuf definition.
1199    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1200        match value {
1201            "STREAM_JOB_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
1202            "STREAM_JOB_STATUS_CREATING" => Some(Self::Creating),
1203            "STREAM_JOB_STATUS_CREATED" => Some(Self::Created),
1204            _ => None,
1205        }
1206    }
1207}
1208/// How the stream job was created will determine
1209/// whether they are persisted.
1210#[derive(prost_helpers::AnyPB)]
1211#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1212#[repr(i32)]
1213pub enum CreateType {
1214    Unspecified = 0,
1215    Background = 1,
1216    Foreground = 2,
1217}
1218impl CreateType {
1219    /// String value of the enum field names used in the ProtoBuf definition.
1220    ///
1221    /// The values are not transformed in any way and thus are considered stable
1222    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1223    pub fn as_str_name(&self) -> &'static str {
1224        match self {
1225            Self::Unspecified => "CREATE_TYPE_UNSPECIFIED",
1226            Self::Background => "CREATE_TYPE_BACKGROUND",
1227            Self::Foreground => "CREATE_TYPE_FOREGROUND",
1228        }
1229    }
1230    /// Creates an enum from field names used in the ProtoBuf definition.
1231    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1232        match value {
1233            "CREATE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1234            "CREATE_TYPE_BACKGROUND" => Some(Self::Background),
1235            "CREATE_TYPE_FOREGROUND" => Some(Self::Foreground),
1236            _ => None,
1237        }
1238    }
1239}
1240#[derive(prost_helpers::AnyPB)]
1241#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1242#[repr(i32)]
1243pub enum SinkType {
1244    Unspecified = 0,
1245    AppendOnly = 1,
1246    /// Deprecated. Use `append_only` + `ignore_delete` instead.
1247    #[deprecated]
1248    ForceAppendOnly = 2,
1249    Upsert = 3,
1250    Retract = 4,
1251}
1252impl SinkType {
1253    /// String value of the enum field names used in the ProtoBuf definition.
1254    ///
1255    /// The values are not transformed in any way and thus are considered stable
1256    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1257    pub fn as_str_name(&self) -> &'static str {
1258        match self {
1259            Self::Unspecified => "SINK_TYPE_UNSPECIFIED",
1260            Self::AppendOnly => "SINK_TYPE_APPEND_ONLY",
1261            #[allow(deprecated)]
1262            Self::ForceAppendOnly => "SINK_TYPE_FORCE_APPEND_ONLY",
1263            Self::Upsert => "SINK_TYPE_UPSERT",
1264            Self::Retract => "SINK_TYPE_RETRACT",
1265        }
1266    }
1267    /// Creates an enum from field names used in the ProtoBuf definition.
1268    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1269        match value {
1270            "SINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
1271            "SINK_TYPE_APPEND_ONLY" => Some(Self::AppendOnly),
1272            "SINK_TYPE_FORCE_APPEND_ONLY" => {
1273                Some(#[allow(deprecated)] Self::ForceAppendOnly)
1274            }
1275            "SINK_TYPE_UPSERT" => Some(Self::Upsert),
1276            "SINK_TYPE_RETRACT" => Some(Self::Retract),
1277            _ => None,
1278        }
1279    }
1280}
1281#[derive(prost_helpers::AnyPB)]
1282#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1283#[repr(i32)]
1284pub enum HandleConflictBehavior {
1285    Unspecified = 0,
1286    Overwrite = 1,
1287    Ignore = 2,
1288    NoCheck = 3,
1289    DoUpdateIfNotNull = 4,
1290}
1291impl HandleConflictBehavior {
1292    /// String value of the enum field names used in the ProtoBuf definition.
1293    ///
1294    /// The values are not transformed in any way and thus are considered stable
1295    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1296    pub fn as_str_name(&self) -> &'static str {
1297        match self {
1298            Self::Unspecified => "HANDLE_CONFLICT_BEHAVIOR_UNSPECIFIED",
1299            Self::Overwrite => "HANDLE_CONFLICT_BEHAVIOR_OVERWRITE",
1300            Self::Ignore => "HANDLE_CONFLICT_BEHAVIOR_IGNORE",
1301            Self::NoCheck => "HANDLE_CONFLICT_BEHAVIOR_NO_CHECK",
1302            Self::DoUpdateIfNotNull => "HANDLE_CONFLICT_BEHAVIOR_DO_UPDATE_IF_NOT_NULL",
1303        }
1304    }
1305    /// Creates an enum from field names used in the ProtoBuf definition.
1306    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1307        match value {
1308            "HANDLE_CONFLICT_BEHAVIOR_UNSPECIFIED" => Some(Self::Unspecified),
1309            "HANDLE_CONFLICT_BEHAVIOR_OVERWRITE" => Some(Self::Overwrite),
1310            "HANDLE_CONFLICT_BEHAVIOR_IGNORE" => Some(Self::Ignore),
1311            "HANDLE_CONFLICT_BEHAVIOR_NO_CHECK" => Some(Self::NoCheck),
1312            "HANDLE_CONFLICT_BEHAVIOR_DO_UPDATE_IF_NOT_NULL" => {
1313                Some(Self::DoUpdateIfNotNull)
1314            }
1315            _ => None,
1316        }
1317    }
1318}
1319/// State of refresh operation for refreshable tables
1320#[derive(prost_helpers::AnyPB)]
1321#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1322#[repr(i32)]
1323pub enum RefreshState {
1324    Unspecified = 0,
1325    Idle = 1,
1326    Refreshing = 2,
1327    Finishing = 3,
1328}
1329impl RefreshState {
1330    /// String value of the enum field names used in the ProtoBuf definition.
1331    ///
1332    /// The values are not transformed in any way and thus are considered stable
1333    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1334    pub fn as_str_name(&self) -> &'static str {
1335        match self {
1336            Self::Unspecified => "REFRESH_STATE_UNSPECIFIED",
1337            Self::Idle => "REFRESH_STATE_IDLE",
1338            Self::Refreshing => "REFRESH_STATE_REFRESHING",
1339            Self::Finishing => "REFRESH_STATE_FINISHING",
1340        }
1341    }
1342    /// Creates an enum from field names used in the ProtoBuf definition.
1343    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1344        match value {
1345            "REFRESH_STATE_UNSPECIFIED" => Some(Self::Unspecified),
1346            "REFRESH_STATE_IDLE" => Some(Self::Idle),
1347            "REFRESH_STATE_REFRESHING" => Some(Self::Refreshing),
1348            "REFRESH_STATE_FINISHING" => Some(Self::Finishing),
1349            _ => None,
1350        }
1351    }
1352}