we are all at v0.7.5 welcome to bulk post, tui-pages support for canvas crate, moved validation-core crate
This commit is contained in:
Binary file not shown.
@@ -55,6 +55,42 @@ pub struct PostTableDataResponse {
|
||||
#[prost(int64, tag = "3")]
|
||||
pub inserted_id: i64,
|
||||
}
|
||||
/// One row in a bulk insert request.
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PostTableDataBulkRow {
|
||||
/// Required. Same data payload as PostTableDataRequest.data.
|
||||
#[prost(map = "string, message", tag = "1")]
|
||||
pub data: ::std::collections::HashMap<
|
||||
::prost::alloc::string::String,
|
||||
::prost_types::Value,
|
||||
>,
|
||||
}
|
||||
/// Bulk insert request.
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PostTableDataBulkRequest {
|
||||
/// Required. Profile (PostgreSQL schema) name that owns the table.
|
||||
#[prost(string, tag = "1")]
|
||||
pub profile_name: ::prost::alloc::string::String,
|
||||
/// Required. Logical table (definition) name within the profile.
|
||||
#[prost(string, tag = "2")]
|
||||
pub table_name: ::prost::alloc::string::String,
|
||||
/// Required. Rows to insert. Must contain at least 1 and at most 10,000 rows.
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub rows: ::prost::alloc::vec::Vec<PostTableDataBulkRow>,
|
||||
}
|
||||
/// Bulk insert response.
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PostTableDataBulkResponse {
|
||||
/// True if all rows were inserted successfully.
|
||||
#[prost(bool, tag = "1")]
|
||||
pub success: bool,
|
||||
/// Human-readable message.
|
||||
#[prost(string, tag = "2")]
|
||||
pub message: ::prost::alloc::string::String,
|
||||
/// Per-row responses from the underlying PostTableData logic, in request order.
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub responses: ::prost::alloc::vec::Vec<PostTableDataResponse>,
|
||||
}
|
||||
/// Update an existing row.
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct PutTableDataRequest {
|
||||
@@ -300,6 +336,44 @@ pub mod tables_data_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Insert multiple rows by applying PostTableData behavior to each row.
|
||||
///
|
||||
/// Behavior:
|
||||
/// - Accepts 1..10,000 rows in one gRPC request
|
||||
/// - Processes rows in request order
|
||||
/// - Each row is inserted through the same validation, script execution,
|
||||
/// typed binding, database insert, and indexing path as PostTableData
|
||||
/// - Stops at the first failing row and returns that row's gRPC error code
|
||||
/// with row index context; rows inserted before the failure remain inserted
|
||||
pub async fn post_table_data_bulk(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::PostTableDataBulkRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PostTableDataBulkResponse>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/komp_ac.tables_data.TablesData/PostTableDataBulk",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new(
|
||||
"komp_ac.tables_data.TablesData",
|
||||
"PostTableDataBulk",
|
||||
),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Update existing row data with strict type binding and script validation.
|
||||
///
|
||||
/// Behavior:
|
||||
@@ -507,6 +581,22 @@ pub mod tables_data_server {
|
||||
tonic::Response<super::PostTableDataResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Insert multiple rows by applying PostTableData behavior to each row.
|
||||
///
|
||||
/// Behavior:
|
||||
/// - Accepts 1..10,000 rows in one gRPC request
|
||||
/// - Processes rows in request order
|
||||
/// - Each row is inserted through the same validation, script execution,
|
||||
/// typed binding, database insert, and indexing path as PostTableData
|
||||
/// - Stops at the first failing row and returns that row's gRPC error code
|
||||
/// with row index context; rows inserted before the failure remain inserted
|
||||
async fn post_table_data_bulk(
|
||||
&self,
|
||||
request: tonic::Request<super::PostTableDataBulkRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::PostTableDataBulkResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Update existing row data with strict type binding and script validation.
|
||||
///
|
||||
/// Behavior:
|
||||
@@ -708,6 +798,52 @@ pub mod tables_data_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.tables_data.TablesData/PostTableDataBulk" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PostTableDataBulkSvc<T: TablesData>(pub Arc<T>);
|
||||
impl<
|
||||
T: TablesData,
|
||||
> tonic::server::UnaryService<super::PostTableDataBulkRequest>
|
||||
for PostTableDataBulkSvc<T> {
|
||||
type Response = super::PostTableDataBulkResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::PostTableDataBulkRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as TablesData>::post_table_data_bulk(&inner, request)
|
||||
.await
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
}
|
||||
let accept_compression_encodings = self.accept_compression_encodings;
|
||||
let send_compression_encodings = self.send_compression_encodings;
|
||||
let max_decoding_message_size = self.max_decoding_message_size;
|
||||
let max_encoding_message_size = self.max_encoding_message_size;
|
||||
let inner = self.inner.clone();
|
||||
let fut = async move {
|
||||
let method = PostTableDataBulkSvc(inner);
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let mut grpc = tonic::server::Grpc::new(codec)
|
||||
.apply_compression_config(
|
||||
accept_compression_encodings,
|
||||
send_compression_encodings,
|
||||
)
|
||||
.apply_max_message_size_config(
|
||||
max_decoding_message_size,
|
||||
max_encoding_message_size,
|
||||
);
|
||||
let res = grpc.unary(method, req).await;
|
||||
Ok(res)
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.tables_data.TablesData/PutTableData" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct PutTableDataSvc<T: TablesData>(pub Arc<T>);
|
||||
|
||||
Reference in New Issue
Block a user