1#[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 #[prost(string, tag = "3")]
9 pub workspace_rid: ::prost::alloc::string::String,
10}
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct SqlServiceQueryResponse {
13 #[prost(bytes = "vec", tag = "1")]
14 pub arrow_payload: ::prost::alloc::vec::Vec<u8>,
15 #[prost(string, tag = "2")]
16 pub query_id: ::prost::alloc::string::String,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct SqlServiceExportRequest {
20 #[prost(string, tag = "1")]
21 pub query: ::prost::alloc::string::String,
22 #[prost(string, tag = "2")]
23 pub workspace_rid: ::prost::alloc::string::String,
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct SqlServiceExportResponse {
27 #[prost(string, tag = "1")]
28 pub presigned_url: ::prost::alloc::string::String,
29 #[prost(string, tag = "2")]
30 pub query_id: ::prost::alloc::string::String,
31}
32#[derive(Clone, Copy, PartialEq, ::prost::Message)]
33pub struct GetSqlCatalogRequest {}
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct SqlCatalogColumn {
36 #[prost(string, tag = "1")]
37 pub name: ::prost::alloc::string::String,
38 #[prost(string, tag = "2")]
39 pub r#type: ::prost::alloc::string::String,
40 #[prost(bool, tag = "3")]
41 pub nullable: bool,
42}
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct SqlCatalogTable {
45 #[prost(string, tag = "1")]
46 pub name: ::prost::alloc::string::String,
47 #[prost(message, repeated, tag = "2")]
48 pub columns: ::prost::alloc::vec::Vec<SqlCatalogColumn>,
49}
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct SqlCatalogFunction {
52 #[prost(string, tag = "1")]
53 pub name: ::prost::alloc::string::String,
54}
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct SqlCatalog {
57 #[prost(message, repeated, tag = "1")]
58 pub tables: ::prost::alloc::vec::Vec<SqlCatalogTable>,
59 #[prost(message, repeated, tag = "2")]
60 pub functions: ::prost::alloc::vec::Vec<SqlCatalogFunction>,
61}
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct GetSqlCatalogResponse {
64 #[prost(message, optional, tag = "1")]
65 pub sql_catalog: ::core::option::Option<SqlCatalog>,
66}
67pub mod sql_service_client {
69 #![allow(
70 unused_variables,
71 dead_code,
72 missing_docs,
73 clippy::wildcard_imports,
74 clippy::let_unit_value,
75 )]
76 use tonic::codegen::*;
77 use tonic::codegen::http::Uri;
78 #[derive(Debug, Clone)]
79 pub struct SqlServiceClient<T> {
80 inner: tonic::client::Grpc<T>,
81 }
82 impl SqlServiceClient<tonic::transport::Channel> {
83 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
85 where
86 D: TryInto<tonic::transport::Endpoint>,
87 D::Error: Into<StdError>,
88 {
89 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
90 Ok(Self::new(conn))
91 }
92 }
93 impl<T> SqlServiceClient<T>
94 where
95 T: tonic::client::GrpcService<tonic::body::Body>,
96 T::Error: Into<StdError>,
97 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
98 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
99 {
100 pub fn new(inner: T) -> Self {
101 let inner = tonic::client::Grpc::new(inner);
102 Self { inner }
103 }
104 pub fn with_origin(inner: T, origin: Uri) -> Self {
105 let inner = tonic::client::Grpc::with_origin(inner, origin);
106 Self { inner }
107 }
108 pub fn with_interceptor<F>(
109 inner: T,
110 interceptor: F,
111 ) -> SqlServiceClient<InterceptedService<T, F>>
112 where
113 F: tonic::service::Interceptor,
114 T::ResponseBody: Default,
115 T: tonic::codegen::Service<
116 http::Request<tonic::body::Body>,
117 Response = http::Response<
118 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
119 >,
120 >,
121 <T as tonic::codegen::Service<
122 http::Request<tonic::body::Body>,
123 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
124 {
125 SqlServiceClient::new(InterceptedService::new(inner, interceptor))
126 }
127 #[must_use]
132 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
133 self.inner = self.inner.send_compressed(encoding);
134 self
135 }
136 #[must_use]
138 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
139 self.inner = self.inner.accept_compressed(encoding);
140 self
141 }
142 #[must_use]
146 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
147 self.inner = self.inner.max_decoding_message_size(limit);
148 self
149 }
150 #[must_use]
154 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
155 self.inner = self.inner.max_encoding_message_size(limit);
156 self
157 }
158 pub async fn query(
159 &mut self,
160 request: impl tonic::IntoRequest<super::SqlServiceQueryRequest>,
161 ) -> std::result::Result<
162 tonic::Response<super::SqlServiceQueryResponse>,
163 tonic::Status,
164 > {
165 self.inner
166 .ready()
167 .await
168 .map_err(|e| {
169 tonic::Status::unknown(
170 format!("Service was not ready: {}", e.into()),
171 )
172 })?;
173 let codec = tonic::codec::ProstCodec::default();
174 let path = http::uri::PathAndQuery::from_static(
175 "/nominal.sql.v1.SqlService/Query",
176 );
177 let mut req = request.into_request();
178 req.extensions_mut()
179 .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Query"));
180 self.inner.unary(req, path, codec).await
181 }
182 pub async fn export(
183 &mut self,
184 request: impl tonic::IntoRequest<super::SqlServiceExportRequest>,
185 ) -> std::result::Result<
186 tonic::Response<super::SqlServiceExportResponse>,
187 tonic::Status,
188 > {
189 self.inner
190 .ready()
191 .await
192 .map_err(|e| {
193 tonic::Status::unknown(
194 format!("Service was not ready: {}", e.into()),
195 )
196 })?;
197 let codec = tonic::codec::ProstCodec::default();
198 let path = http::uri::PathAndQuery::from_static(
199 "/nominal.sql.v1.SqlService/Export",
200 );
201 let mut req = request.into_request();
202 req.extensions_mut()
203 .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "Export"));
204 self.inner.unary(req, path, codec).await
205 }
206 pub async fn get_sql_catalog(
207 &mut self,
208 request: impl tonic::IntoRequest<super::GetSqlCatalogRequest>,
209 ) -> std::result::Result<
210 tonic::Response<super::GetSqlCatalogResponse>,
211 tonic::Status,
212 > {
213 self.inner
214 .ready()
215 .await
216 .map_err(|e| {
217 tonic::Status::unknown(
218 format!("Service was not ready: {}", e.into()),
219 )
220 })?;
221 let codec = tonic::codec::ProstCodec::default();
222 let path = http::uri::PathAndQuery::from_static(
223 "/nominal.sql.v1.SqlService/GetSqlCatalog",
224 );
225 let mut req = request.into_request();
226 req.extensions_mut()
227 .insert(GrpcMethod::new("nominal.sql.v1.SqlService", "GetSqlCatalog"));
228 self.inner.unary(req, path, codec).await
229 }
230 }
231}