Skip to main content

nominal_api_proto/proto/
nominal.sql.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct SqlQueryLogEvent {
4    #[prost(string, tag = "1")]
5    pub query_id: ::prost::alloc::string::String,
6    #[prost(enumeration = "SqlQueryEventType", tag = "2")]
7    pub event_type: i32,
8    #[prost(string, tag = "3")]
9    pub workspace_rid: ::prost::alloc::string::String,
10    #[prost(string, tag = "4")]
11    pub user_rid: ::prost::alloc::string::String,
12    #[prost(enumeration = "SqlQueryBackend", repeated, tag = "5")]
13    pub backends: ::prost::alloc::vec::Vec<i32>,
14    #[prost(enumeration = "SqlQueryStatus", optional, tag = "6")]
15    pub status: ::core::option::Option<i32>,
16    #[prost(string, tag = "7")]
17    pub query_text: ::prost::alloc::string::String,
18    #[prost(message, optional, tag = "8")]
19    pub event_time: ::core::option::Option<
20        super::super::super::google::protobuf::Timestamp,
21    >,
22    #[prost(message, optional, tag = "9")]
23    pub started_at: ::core::option::Option<
24        super::super::super::google::protobuf::Timestamp,
25    >,
26    #[prost(message, optional, tag = "10")]
27    pub finished_at: ::core::option::Option<
28        super::super::super::google::protobuf::Timestamp,
29    >,
30    #[prost(int64, optional, tag = "11")]
31    pub duration_ms: ::core::option::Option<i64>,
32    #[prost(string, tag = "12")]
33    pub org_rid: ::prost::alloc::string::String,
34    #[prost(int64, optional, tag = "13")]
35    pub error_code: ::core::option::Option<i64>,
36    #[prost(string, optional, tag = "14")]
37    pub error_message: ::core::option::Option<::prost::alloc::string::String>,
38    #[prost(string, repeated, tag = "15")]
39    pub lowered_postgres: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
40}
41#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
42#[repr(i32)]
43pub enum SqlQueryEventType {
44    QueryStart = 0,
45    QueryFinish = 1,
46    ErrorBeforeStart = 2,
47    ErrorWhileProcessing = 3,
48}
49impl SqlQueryEventType {
50    /// String value of the enum field names used in the ProtoBuf definition.
51    ///
52    /// The values are not transformed in any way and thus are considered stable
53    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
54    pub fn as_str_name(&self) -> &'static str {
55        match self {
56            Self::QueryStart => "SQL_QUERY_EVENT_TYPE_QUERY_START",
57            Self::QueryFinish => "SQL_QUERY_EVENT_TYPE_QUERY_FINISH",
58            Self::ErrorBeforeStart => "SQL_QUERY_EVENT_TYPE_ERROR_BEFORE_START",
59            Self::ErrorWhileProcessing => "SQL_QUERY_EVENT_TYPE_ERROR_WHILE_PROCESSING",
60        }
61    }
62    /// Creates an enum from field names used in the ProtoBuf definition.
63    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
64        match value {
65            "SQL_QUERY_EVENT_TYPE_QUERY_START" => Some(Self::QueryStart),
66            "SQL_QUERY_EVENT_TYPE_QUERY_FINISH" => Some(Self::QueryFinish),
67            "SQL_QUERY_EVENT_TYPE_ERROR_BEFORE_START" => Some(Self::ErrorBeforeStart),
68            "SQL_QUERY_EVENT_TYPE_ERROR_WHILE_PROCESSING" => {
69                Some(Self::ErrorWhileProcessing)
70            }
71            _ => None,
72        }
73    }
74}
75#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
76#[repr(i32)]
77pub enum SqlQueryBackend {
78    Clickhouse = 0,
79    Postgres = 1,
80}
81impl SqlQueryBackend {
82    /// String value of the enum field names used in the ProtoBuf definition.
83    ///
84    /// The values are not transformed in any way and thus are considered stable
85    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
86    pub fn as_str_name(&self) -> &'static str {
87        match self {
88            Self::Clickhouse => "SQL_QUERY_BACKEND_CLICKHOUSE",
89            Self::Postgres => "SQL_QUERY_BACKEND_POSTGRES",
90        }
91    }
92    /// Creates an enum from field names used in the ProtoBuf definition.
93    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
94        match value {
95            "SQL_QUERY_BACKEND_CLICKHOUSE" => Some(Self::Clickhouse),
96            "SQL_QUERY_BACKEND_POSTGRES" => Some(Self::Postgres),
97            _ => None,
98        }
99    }
100}
101#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
102#[repr(i32)]
103pub enum SqlQueryStatus {
104    Succeeded = 0,
105    Failed = 1,
106    Throttled = 2,
107    TimedOut = 3,
108}
109impl SqlQueryStatus {
110    /// String value of the enum field names used in the ProtoBuf definition.
111    ///
112    /// The values are not transformed in any way and thus are considered stable
113    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
114    pub fn as_str_name(&self) -> &'static str {
115        match self {
116            Self::Succeeded => "SQL_QUERY_STATUS_SUCCEEDED",
117            Self::Failed => "SQL_QUERY_STATUS_FAILED",
118            Self::Throttled => "SQL_QUERY_STATUS_THROTTLED",
119            Self::TimedOut => "SQL_QUERY_STATUS_TIMED_OUT",
120        }
121    }
122    /// Creates an enum from field names used in the ProtoBuf definition.
123    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
124        match value {
125            "SQL_QUERY_STATUS_SUCCEEDED" => Some(Self::Succeeded),
126            "SQL_QUERY_STATUS_FAILED" => Some(Self::Failed),
127            "SQL_QUERY_STATUS_THROTTLED" => Some(Self::Throttled),
128            "SQL_QUERY_STATUS_TIMED_OUT" => Some(Self::TimedOut),
129            _ => None,
130        }
131    }
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct SqlServiceQueryRequest {
135    #[prost(string, tag = "1")]
136    pub query: ::prost::alloc::string::String,
137    #[prost(int32, optional, tag = "2")]
138    pub max_rows: ::core::option::Option<i32>,
139    #[prost(string, tag = "3")]
140    pub workspace_rid: ::prost::alloc::string::String,
141    #[prost(enumeration = "SqlServiceQueryResultFormat", tag = "4")]
142    pub result_format: i32,
143}
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct SqlServiceQueryResponse {
146    #[prost(string, tag = "2")]
147    pub query_id: ::prost::alloc::string::String,
148    #[prost(bytes = "vec", tag = "3")]
149    pub payload: ::prost::alloc::vec::Vec<u8>,
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct SqlServiceExportRequest {
153    #[prost(string, tag = "1")]
154    pub query: ::prost::alloc::string::String,
155    #[prost(string, tag = "2")]
156    pub workspace_rid: ::prost::alloc::string::String,
157}
158#[derive(Clone, PartialEq, ::prost::Message)]
159pub struct SqlServiceExportResponse {
160    #[prost(string, tag = "1")]
161    pub presigned_url: ::prost::alloc::string::String,
162    #[prost(string, tag = "2")]
163    pub query_id: ::prost::alloc::string::String,
164}
165#[derive(Clone, Copy, PartialEq, ::prost::Message)]
166pub struct GetSqlCatalogRequest {}
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct SqlCatalogMapType {
169    #[prost(message, optional, boxed, tag = "1")]
170    pub key: ::core::option::Option<::prost::alloc::boxed::Box<SqlCatalogDataType>>,
171    #[prost(message, optional, boxed, tag = "2")]
172    pub value: ::core::option::Option<::prost::alloc::boxed::Box<SqlCatalogDataType>>,
173}
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct SqlCatalogDataType {
176    #[prost(oneof = "sql_catalog_data_type::Kind", tags = "1, 2, 3")]
177    pub kind: ::core::option::Option<sql_catalog_data_type::Kind>,
178}
179/// Nested message and enum types in `SqlCatalogDataType`.
180pub mod sql_catalog_data_type {
181    #[derive(Clone, PartialEq, ::prost::Oneof)]
182    pub enum Kind {
183        #[prost(enumeration = "super::SqlCatalogScalarType", tag = "1")]
184        Scalar(i32),
185        #[prost(message, tag = "2")]
186        ArrayElement(::prost::alloc::boxed::Box<super::SqlCatalogDataType>),
187        #[prost(message, tag = "3")]
188        Map(::prost::alloc::boxed::Box<super::SqlCatalogMapType>),
189    }
190}
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct SqlCatalogColumn {
193    #[prost(string, tag = "1")]
194    pub name: ::prost::alloc::string::String,
195    #[prost(string, tag = "2")]
196    pub r#type: ::prost::alloc::string::String,
197    #[prost(bool, tag = "3")]
198    pub nullable: bool,
199    #[prost(message, optional, tag = "4")]
200    pub data_type: ::core::option::Option<SqlCatalogDataType>,
201}
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct SqlCatalogTable {
204    #[prost(string, tag = "1")]
205    pub name: ::prost::alloc::string::String,
206    #[prost(message, repeated, tag = "2")]
207    pub columns: ::prost::alloc::vec::Vec<SqlCatalogColumn>,
208}
209#[derive(Clone, PartialEq, ::prost::Message)]
210pub struct SqlCatalogFunction {
211    #[prost(string, tag = "1")]
212    pub name: ::prost::alloc::string::String,
213    #[prost(enumeration = "SqlCatalogFunctionKind", tag = "2")]
214    pub kind: i32,
215    #[prost(bool, tag = "3")]
216    pub supports_over: bool,
217    #[prost(int32, tag = "4")]
218    pub min_args: i32,
219    #[prost(int32, optional, tag = "5")]
220    pub max_args: ::core::option::Option<i32>,
221    #[prost(string, repeated, tag = "6")]
222    pub argument_type_families: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
223    #[prost(string, optional, tag = "7")]
224    pub return_type_family: ::core::option::Option<::prost::alloc::string::String>,
225}
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct SqlCatalog {
228    #[prost(message, repeated, tag = "1")]
229    pub tables: ::prost::alloc::vec::Vec<SqlCatalogTable>,
230    #[prost(message, repeated, tag = "2")]
231    pub functions: ::prost::alloc::vec::Vec<SqlCatalogFunction>,
232}
233#[derive(Clone, PartialEq, ::prost::Message)]
234pub struct GetSqlCatalogResponse {
235    #[prost(message, optional, tag = "1")]
236    pub sql_catalog: ::core::option::Option<SqlCatalog>,
237}
238#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
239#[repr(i32)]
240pub enum SqlError {
241    Unspecified = 0,
242    InvalidQuery = 1,
243    DatasetsNotFound = 2,
244    ExecutionFailed = 3,
245    ExportNotSupportedForBackend = 4,
246    ExportNotConfigured = 5,
247    QueryTimeout = 6,
248    ResourceExhausted = 7,
249    DatasetStorageTypeNotSupported = 8,
250    DataNotFoundForType = 9,
251    ResultSizeExceeded = 10,
252    QueryScopeTooLarge = 11,
253    QueryCancelled = 12,
254    MemoryLimitExceeded = 13,
255}
256impl SqlError {
257    /// String value of the enum field names used in the ProtoBuf definition.
258    ///
259    /// The values are not transformed in any way and thus are considered stable
260    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
261    pub fn as_str_name(&self) -> &'static str {
262        match self {
263            Self::Unspecified => "SQL_ERROR_UNSPECIFIED",
264            Self::InvalidQuery => "SQL_ERROR_INVALID_QUERY",
265            Self::DatasetsNotFound => "SQL_ERROR_DATASETS_NOT_FOUND",
266            Self::ExecutionFailed => "SQL_ERROR_EXECUTION_FAILED",
267            Self::ExportNotSupportedForBackend => {
268                "SQL_ERROR_EXPORT_NOT_SUPPORTED_FOR_BACKEND"
269            }
270            Self::ExportNotConfigured => "SQL_ERROR_EXPORT_NOT_CONFIGURED",
271            Self::QueryTimeout => "SQL_ERROR_QUERY_TIMEOUT",
272            Self::ResourceExhausted => "SQL_ERROR_RESOURCE_EXHAUSTED",
273            Self::DatasetStorageTypeNotSupported => {
274                "SQL_ERROR_DATASET_STORAGE_TYPE_NOT_SUPPORTED"
275            }
276            Self::DataNotFoundForType => "SQL_ERROR_DATA_NOT_FOUND_FOR_TYPE",
277            Self::ResultSizeExceeded => "SQL_ERROR_RESULT_SIZE_EXCEEDED",
278            Self::QueryScopeTooLarge => "SQL_ERROR_QUERY_SCOPE_TOO_LARGE",
279            Self::QueryCancelled => "SQL_ERROR_QUERY_CANCELLED",
280            Self::MemoryLimitExceeded => "SQL_ERROR_MEMORY_LIMIT_EXCEEDED",
281        }
282    }
283    /// Creates an enum from field names used in the ProtoBuf definition.
284    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
285        match value {
286            "SQL_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
287            "SQL_ERROR_INVALID_QUERY" => Some(Self::InvalidQuery),
288            "SQL_ERROR_DATASETS_NOT_FOUND" => Some(Self::DatasetsNotFound),
289            "SQL_ERROR_EXECUTION_FAILED" => Some(Self::ExecutionFailed),
290            "SQL_ERROR_EXPORT_NOT_SUPPORTED_FOR_BACKEND" => {
291                Some(Self::ExportNotSupportedForBackend)
292            }
293            "SQL_ERROR_EXPORT_NOT_CONFIGURED" => Some(Self::ExportNotConfigured),
294            "SQL_ERROR_QUERY_TIMEOUT" => Some(Self::QueryTimeout),
295            "SQL_ERROR_RESOURCE_EXHAUSTED" => Some(Self::ResourceExhausted),
296            "SQL_ERROR_DATASET_STORAGE_TYPE_NOT_SUPPORTED" => {
297                Some(Self::DatasetStorageTypeNotSupported)
298            }
299            "SQL_ERROR_DATA_NOT_FOUND_FOR_TYPE" => Some(Self::DataNotFoundForType),
300            "SQL_ERROR_RESULT_SIZE_EXCEEDED" => Some(Self::ResultSizeExceeded),
301            "SQL_ERROR_QUERY_SCOPE_TOO_LARGE" => Some(Self::QueryScopeTooLarge),
302            "SQL_ERROR_QUERY_CANCELLED" => Some(Self::QueryCancelled),
303            "SQL_ERROR_MEMORY_LIMIT_EXCEEDED" => Some(Self::MemoryLimitExceeded),
304            _ => None,
305        }
306    }
307}
308#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
309#[repr(i32)]
310pub enum SqlServiceQueryResultFormat {
311    Unspecified = 0,
312    ArrowStream = 1,
313    JsonLines = 2,
314    Csv = 3,
315}
316impl SqlServiceQueryResultFormat {
317    /// String value of the enum field names used in the ProtoBuf definition.
318    ///
319    /// The values are not transformed in any way and thus are considered stable
320    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
321    pub fn as_str_name(&self) -> &'static str {
322        match self {
323            Self::Unspecified => "SQL_SERVICE_QUERY_RESULT_FORMAT_UNSPECIFIED",
324            Self::ArrowStream => "SQL_SERVICE_QUERY_RESULT_FORMAT_ARROW_STREAM",
325            Self::JsonLines => "SQL_SERVICE_QUERY_RESULT_FORMAT_JSON_LINES",
326            Self::Csv => "SQL_SERVICE_QUERY_RESULT_FORMAT_CSV",
327        }
328    }
329    /// Creates an enum from field names used in the ProtoBuf definition.
330    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
331        match value {
332            "SQL_SERVICE_QUERY_RESULT_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
333            "SQL_SERVICE_QUERY_RESULT_FORMAT_ARROW_STREAM" => Some(Self::ArrowStream),
334            "SQL_SERVICE_QUERY_RESULT_FORMAT_JSON_LINES" => Some(Self::JsonLines),
335            "SQL_SERVICE_QUERY_RESULT_FORMAT_CSV" => Some(Self::Csv),
336            _ => None,
337        }
338    }
339}
340#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
341#[repr(i32)]
342pub enum SqlCatalogScalarType {
343    Unspecified = 0,
344    Varchar = 1,
345    Boolean = 2,
346    Integer = 3,
347    Bigint = 4,
348    Double = 5,
349    Timestamp = 6,
350    Any = 7,
351}
352impl SqlCatalogScalarType {
353    /// String value of the enum field names used in the ProtoBuf definition.
354    ///
355    /// The values are not transformed in any way and thus are considered stable
356    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
357    pub fn as_str_name(&self) -> &'static str {
358        match self {
359            Self::Unspecified => "SQL_CATALOG_SCALAR_TYPE_UNSPECIFIED",
360            Self::Varchar => "SQL_CATALOG_SCALAR_TYPE_VARCHAR",
361            Self::Boolean => "SQL_CATALOG_SCALAR_TYPE_BOOLEAN",
362            Self::Integer => "SQL_CATALOG_SCALAR_TYPE_INTEGER",
363            Self::Bigint => "SQL_CATALOG_SCALAR_TYPE_BIGINT",
364            Self::Double => "SQL_CATALOG_SCALAR_TYPE_DOUBLE",
365            Self::Timestamp => "SQL_CATALOG_SCALAR_TYPE_TIMESTAMP",
366            Self::Any => "SQL_CATALOG_SCALAR_TYPE_ANY",
367        }
368    }
369    /// Creates an enum from field names used in the ProtoBuf definition.
370    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
371        match value {
372            "SQL_CATALOG_SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
373            "SQL_CATALOG_SCALAR_TYPE_VARCHAR" => Some(Self::Varchar),
374            "SQL_CATALOG_SCALAR_TYPE_BOOLEAN" => Some(Self::Boolean),
375            "SQL_CATALOG_SCALAR_TYPE_INTEGER" => Some(Self::Integer),
376            "SQL_CATALOG_SCALAR_TYPE_BIGINT" => Some(Self::Bigint),
377            "SQL_CATALOG_SCALAR_TYPE_DOUBLE" => Some(Self::Double),
378            "SQL_CATALOG_SCALAR_TYPE_TIMESTAMP" => Some(Self::Timestamp),
379            "SQL_CATALOG_SCALAR_TYPE_ANY" => Some(Self::Any),
380            _ => None,
381        }
382    }
383}
384#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
385#[repr(i32)]
386pub enum SqlCatalogFunctionKind {
387    Unspecified = 0,
388    Scalar = 1,
389    Aggregate = 2,
390    Window = 3,
391    Table = 4,
392}
393impl SqlCatalogFunctionKind {
394    /// String value of the enum field names used in the ProtoBuf definition.
395    ///
396    /// The values are not transformed in any way and thus are considered stable
397    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
398    pub fn as_str_name(&self) -> &'static str {
399        match self {
400            Self::Unspecified => "SQL_CATALOG_FUNCTION_KIND_UNSPECIFIED",
401            Self::Scalar => "SQL_CATALOG_FUNCTION_KIND_SCALAR",
402            Self::Aggregate => "SQL_CATALOG_FUNCTION_KIND_AGGREGATE",
403            Self::Window => "SQL_CATALOG_FUNCTION_KIND_WINDOW",
404            Self::Table => "SQL_CATALOG_FUNCTION_KIND_TABLE",
405        }
406    }
407    /// Creates an enum from field names used in the ProtoBuf definition.
408    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
409        match value {
410            "SQL_CATALOG_FUNCTION_KIND_UNSPECIFIED" => Some(Self::Unspecified),
411            "SQL_CATALOG_FUNCTION_KIND_SCALAR" => Some(Self::Scalar),
412            "SQL_CATALOG_FUNCTION_KIND_AGGREGATE" => Some(Self::Aggregate),
413            "SQL_CATALOG_FUNCTION_KIND_WINDOW" => Some(Self::Window),
414            "SQL_CATALOG_FUNCTION_KIND_TABLE" => Some(Self::Table),
415            _ => None,
416        }
417    }
418}
419/// Generated client implementations.
420pub mod sql_service_client {
421    #![allow(
422        unused_variables,
423        dead_code,
424        missing_docs,
425        clippy::wildcard_imports,
426        clippy::let_unit_value,
427    )]
428    use tonic::codegen::*;
429    use tonic::codegen::http::Uri;
430    #[derive(Debug, Clone)]
431    pub struct SqlServiceClient<T> {
432        inner: tonic::client::Grpc<T>,
433    }
434    impl SqlServiceClient<tonic::transport::Channel> {
435        /// Attempt to create a new client by connecting to a given endpoint.
436        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
437        where
438            D: TryInto<tonic::transport::Endpoint>,
439            D::Error: Into<StdError>,
440        {
441            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
442            Ok(Self::new(conn))
443        }
444    }
445    impl<T> SqlServiceClient<T>
446    where
447        T: tonic::client::GrpcService<tonic::body::Body>,
448        T::Error: Into<StdError>,
449        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
450        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
451    {
452        pub fn new(inner: T) -> Self {
453            let inner = tonic::client::Grpc::new(inner);
454            Self { inner }
455        }
456        pub fn with_origin(inner: T, origin: Uri) -> Self {
457            let inner = tonic::client::Grpc::with_origin(inner, origin);
458            Self { inner }
459        }
460        pub fn with_interceptor<F>(
461            inner: T,
462            interceptor: F,
463        ) -> SqlServiceClient<InterceptedService<T, F>>
464        where
465            F: tonic::service::Interceptor,
466            T::ResponseBody: Default,
467            T: tonic::codegen::Service<
468                http::Request<tonic::body::Body>,
469                Response = http::Response<
470                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
471                >,
472            >,
473            <T as tonic::codegen::Service<
474                http::Request<tonic::body::Body>,
475            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
476        {
477            SqlServiceClient::new(InterceptedService::new(inner, interceptor))
478        }
479        /// Compress requests with the given encoding.
480        ///
481        /// This requires the server to support it otherwise it might respond with an
482        /// error.
483        #[must_use]
484        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
485            self.inner = self.inner.send_compressed(encoding);
486            self
487        }
488        /// Enable decompressing responses.
489        #[must_use]
490        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
491            self.inner = self.inner.accept_compressed(encoding);
492            self
493        }
494        /// Limits the maximum size of a decoded message.
495        ///
496        /// Default: `4MB`
497        #[must_use]
498        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
499            self.inner = self.inner.max_decoding_message_size(limit);
500            self
501        }
502        /// Limits the maximum size of an encoded message.
503        ///
504        /// Default: `usize::MAX`
505        #[must_use]
506        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
507            self.inner = self.inner.max_encoding_message_size(limit);
508            self
509        }
510        pub async fn query(
511            &mut self,
512            request: impl tonic::IntoRequest<super::SqlServiceQueryRequest>,
513        ) -> std::result::Result<
514            tonic::Response<tonic::codec::Streaming<super::SqlServiceQueryResponse>>,
515            tonic::Status,
516        > {
517            self.inner
518                .ready()
519                .await
520                .map_err(|e| {
521                    tonic::Status::unknown(
522                        format!("Service was not ready: {}", e.into()),
523                    )
524                })?;
525            let codec = tonic::codec::ProstCodec::default();
526            let path = http::uri::PathAndQuery::from_static(
527                "/nominal.sql.v1.SqlService/Query",
528            );
529            let mut req = request.into_request();
530            req.extensions_mut()
531                .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Query"));
532            self.inner.server_streaming(req, path, codec).await
533        }
534        pub async fn export(
535            &mut self,
536            request: impl tonic::IntoRequest<super::SqlServiceExportRequest>,
537        ) -> std::result::Result<
538            tonic::Response<super::SqlServiceExportResponse>,
539            tonic::Status,
540        > {
541            self.inner
542                .ready()
543                .await
544                .map_err(|e| {
545                    tonic::Status::unknown(
546                        format!("Service was not ready: {}", e.into()),
547                    )
548                })?;
549            let codec = tonic::codec::ProstCodec::default();
550            let path = http::uri::PathAndQuery::from_static(
551                "/nominal.sql.v1.SqlService/Export",
552            );
553            let mut req = request.into_request();
554            req.extensions_mut()
555                .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Export"));
556            self.inner.unary(req, path, codec).await
557        }
558        pub async fn get_sql_catalog(
559            &mut self,
560            request: impl tonic::IntoRequest<super::GetSqlCatalogRequest>,
561        ) -> std::result::Result<
562            tonic::Response<super::GetSqlCatalogResponse>,
563            tonic::Status,
564        > {
565            self.inner
566                .ready()
567                .await
568                .map_err(|e| {
569                    tonic::Status::unknown(
570                        format!("Service was not ready: {}", e.into()),
571                    )
572                })?;
573            let codec = tonic::codec::ProstCodec::default();
574            let path = http::uri::PathAndQuery::from_static(
575                "/nominal.sql.v1.SqlService/GetSqlCatalog",
576            );
577            let mut req = request.into_request();
578            req.extensions_mut()
579                .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "GetSqlCatalog"));
580            self.inner.unary(req, path, codec).await
581        }
582    }
583}