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 SqlServiceQueryRequest {
4    #[prost(string, tag = "1")]
5    pub query: ::prost::alloc::string::String,
6    #[prost(int32, optional, tag = "2")]
7    pub max_rows: ::core::option::Option<i32>,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct SqlServiceQueryResponse {
11    #[prost(bytes = "vec", tag = "1")]
12    pub arrow_payload: ::prost::alloc::vec::Vec<u8>,
13    #[prost(string, tag = "2")]
14    pub query_id: ::prost::alloc::string::String,
15}
16/// Generated client implementations.
17pub mod sql_service_client {
18    #![allow(
19        unused_variables,
20        dead_code,
21        missing_docs,
22        clippy::wildcard_imports,
23        clippy::let_unit_value,
24    )]
25    use tonic::codegen::*;
26    use tonic::codegen::http::Uri;
27    #[derive(Debug, Clone)]
28    pub struct SqlServiceClient<T> {
29        inner: tonic::client::Grpc<T>,
30    }
31    impl SqlServiceClient<tonic::transport::Channel> {
32        /// Attempt to create a new client by connecting to a given endpoint.
33        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
34        where
35            D: TryInto<tonic::transport::Endpoint>,
36            D::Error: Into<StdError>,
37        {
38            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
39            Ok(Self::new(conn))
40        }
41    }
42    impl<T> SqlServiceClient<T>
43    where
44        T: tonic::client::GrpcService<tonic::body::Body>,
45        T::Error: Into<StdError>,
46        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
47        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
48    {
49        pub fn new(inner: T) -> Self {
50            let inner = tonic::client::Grpc::new(inner);
51            Self { inner }
52        }
53        pub fn with_origin(inner: T, origin: Uri) -> Self {
54            let inner = tonic::client::Grpc::with_origin(inner, origin);
55            Self { inner }
56        }
57        pub fn with_interceptor<F>(
58            inner: T,
59            interceptor: F,
60        ) -> SqlServiceClient<InterceptedService<T, F>>
61        where
62            F: tonic::service::Interceptor,
63            T::ResponseBody: Default,
64            T: tonic::codegen::Service<
65                http::Request<tonic::body::Body>,
66                Response = http::Response<
67                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
68                >,
69            >,
70            <T as tonic::codegen::Service<
71                http::Request<tonic::body::Body>,
72            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
73        {
74            SqlServiceClient::new(InterceptedService::new(inner, interceptor))
75        }
76        /// Compress requests with the given encoding.
77        ///
78        /// This requires the server to support it otherwise it might respond with an
79        /// error.
80        #[must_use]
81        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
82            self.inner = self.inner.send_compressed(encoding);
83            self
84        }
85        /// Enable decompressing responses.
86        #[must_use]
87        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
88            self.inner = self.inner.accept_compressed(encoding);
89            self
90        }
91        /// Limits the maximum size of a decoded message.
92        ///
93        /// Default: `4MB`
94        #[must_use]
95        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
96            self.inner = self.inner.max_decoding_message_size(limit);
97            self
98        }
99        /// Limits the maximum size of an encoded message.
100        ///
101        /// Default: `usize::MAX`
102        #[must_use]
103        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
104            self.inner = self.inner.max_encoding_message_size(limit);
105            self
106        }
107        pub async fn query(
108            &mut self,
109            request: impl tonic::IntoRequest<super::SqlServiceQueryRequest>,
110        ) -> std::result::Result<
111            tonic::Response<super::SqlServiceQueryResponse>,
112            tonic::Status,
113        > {
114            self.inner
115                .ready()
116                .await
117                .map_err(|e| {
118                    tonic::Status::unknown(
119                        format!("Service was not ready: {}", e.into()),
120                    )
121                })?;
122            let codec = tonic::codec::ProstCodec::default();
123            let path = http::uri::PathAndQuery::from_static(
124                "/nominal.sql.v1.SqlService/Query",
125            );
126            let mut req = request.into_request();
127            req.extensions_mut()
128                .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Query"));
129            self.inner.unary(req, path, codec).await
130        }
131    }
132}