nominal_api_proto/proto/
nominal.sql.v1.rs1#[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}
14pub mod sql_service_client {
16 #![allow(
17 unused_variables,
18 dead_code,
19 missing_docs,
20 clippy::wildcard_imports,
21 clippy::let_unit_value,
22 )]
23 use tonic::codegen::*;
24 use tonic::codegen::http::Uri;
25 #[derive(Debug, Clone)]
26 pub struct SqlServiceClient<T> {
27 inner: tonic::client::Grpc<T>,
28 }
29 impl SqlServiceClient<tonic::transport::Channel> {
30 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
32 where
33 D: TryInto<tonic::transport::Endpoint>,
34 D::Error: Into<StdError>,
35 {
36 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
37 Ok(Self::new(conn))
38 }
39 }
40 impl<T> SqlServiceClient<T>
41 where
42 T: tonic::client::GrpcService<tonic::body::Body>,
43 T::Error: Into<StdError>,
44 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
45 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
46 {
47 pub fn new(inner: T) -> Self {
48 let inner = tonic::client::Grpc::new(inner);
49 Self { inner }
50 }
51 pub fn with_origin(inner: T, origin: Uri) -> Self {
52 let inner = tonic::client::Grpc::with_origin(inner, origin);
53 Self { inner }
54 }
55 pub fn with_interceptor<F>(
56 inner: T,
57 interceptor: F,
58 ) -> SqlServiceClient<InterceptedService<T, F>>
59 where
60 F: tonic::service::Interceptor,
61 T::ResponseBody: Default,
62 T: tonic::codegen::Service<
63 http::Request<tonic::body::Body>,
64 Response = http::Response<
65 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
66 >,
67 >,
68 <T as tonic::codegen::Service<
69 http::Request<tonic::body::Body>,
70 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
71 {
72 SqlServiceClient::new(InterceptedService::new(inner, interceptor))
73 }
74 #[must_use]
79 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
80 self.inner = self.inner.send_compressed(encoding);
81 self
82 }
83 #[must_use]
85 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
86 self.inner = self.inner.accept_compressed(encoding);
87 self
88 }
89 #[must_use]
93 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
94 self.inner = self.inner.max_decoding_message_size(limit);
95 self
96 }
97 #[must_use]
101 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
102 self.inner = self.inner.max_encoding_message_size(limit);
103 self
104 }
105 pub async fn query(
106 &mut self,
107 request: impl tonic::IntoRequest<super::SqlServiceQueryRequest>,
108 ) -> std::result::Result<
109 tonic::Response<super::SqlServiceQueryResponse>,
110 tonic::Status,
111 > {
112 self.inner
113 .ready()
114 .await
115 .map_err(|e| {
116 tonic::Status::unknown(
117 format!("Service was not ready: {}", e.into()),
118 )
119 })?;
120 let codec = tonic::codec::ProstCodec::default();
121 let path = http::uri::PathAndQuery::from_static(
122 "/nominal.sql.v1.SqlService/Query",
123 );
124 let mut req = request.into_request();
125 req.extensions_mut()
126 .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Query"));
127 self.inner.unary(req, path, codec).await
128 }
129 }
130}