required columns
This commit is contained in:
Submodule client-gui2 updated: 6af9d5a127...a03fce2679
@@ -70,6 +70,10 @@ service TableDefinition {
|
|||||||
// indexes are created or dropped even when rows have already been stored.
|
// indexes are created or dropped even when rows have already been stored.
|
||||||
rpc SetTableIndexes(SetTableIndexesRequest) returns (SetTableIndexesResponse);
|
rpc SetTableIndexes(SetTableIndexesRequest) returns (SetTableIndexesResponse);
|
||||||
|
|
||||||
|
// Changes whether one existing column is required. Enabling the requirement
|
||||||
|
// is rejected while an active row has no value for the column.
|
||||||
|
rpc SetColumnRequired(SetColumnRequiredRequest) returns (SetColumnRequiredResponse);
|
||||||
|
|
||||||
// Replaces the optional user-visible aliases for a fixed-option column.
|
// Replaces the optional user-visible aliases for a fixed-option column.
|
||||||
// Stored values remain stable machine values and scripts never depend on labels.
|
// Stored values remain stable machine values and scripts never depend on labels.
|
||||||
rpc SetColumnOptionAliases(SetColumnOptionAliasesRequest) returns (SetColumnOptionAliasesResponse);
|
rpc SetColumnOptionAliases(SetColumnOptionAliasesRequest) returns (SetColumnOptionAliasesResponse);
|
||||||
@@ -632,6 +636,24 @@ message SetTableIndexesResponse {
|
|||||||
int64 row_version = 3;
|
int64 row_version = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message SetColumnRequiredRequest {
|
||||||
|
string profile_name = 1;
|
||||||
|
string table_name = 2;
|
||||||
|
// Stable column identity returned in GetProfileDetails.column_behaviors.
|
||||||
|
int64 column_id = 3;
|
||||||
|
bool required = 4;
|
||||||
|
// Row version returned by GetProfileDetails when the column was read.
|
||||||
|
int64 expected_row_version = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SetColumnRequiredResponse {
|
||||||
|
bool success = 1;
|
||||||
|
int64 column_id = 2;
|
||||||
|
bool required = 3;
|
||||||
|
// New row version after the update, or the current version for a no-op.
|
||||||
|
int64 row_version = 4;
|
||||||
|
}
|
||||||
|
|
||||||
// One public option name. `value` identifies the option by its current public
|
// One public option name. `value` identifies the option by its current public
|
||||||
// alias and `alias` is its desired public alias; stored values remain internal.
|
// alias and `alias` is its desired public alias; stored values remain internal.
|
||||||
message OptionValueAlias {
|
message OptionValueAlias {
|
||||||
|
|||||||
Binary file not shown.
@@ -683,6 +683,35 @@ pub struct SetTableIndexesResponse {
|
|||||||
#[prost(int64, tag = "3")]
|
#[prost(int64, tag = "3")]
|
||||||
pub row_version: i64,
|
pub row_version: i64,
|
||||||
}
|
}
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
|
pub struct SetColumnRequiredRequest {
|
||||||
|
#[prost(string, tag = "1")]
|
||||||
|
pub profile_name: ::prost::alloc::string::String,
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub table_name: ::prost::alloc::string::String,
|
||||||
|
/// Stable column identity returned in GetProfileDetails.column_behaviors.
|
||||||
|
#[prost(int64, tag = "3")]
|
||||||
|
pub column_id: i64,
|
||||||
|
#[prost(bool, tag = "4")]
|
||||||
|
pub required: bool,
|
||||||
|
/// Row version returned by GetProfileDetails when the column was read.
|
||||||
|
#[prost(int64, tag = "5")]
|
||||||
|
pub expected_row_version: i64,
|
||||||
|
}
|
||||||
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||||
|
pub struct SetColumnRequiredResponse {
|
||||||
|
#[prost(bool, tag = "1")]
|
||||||
|
pub success: bool,
|
||||||
|
#[prost(int64, tag = "2")]
|
||||||
|
pub column_id: i64,
|
||||||
|
#[prost(bool, tag = "3")]
|
||||||
|
pub required: bool,
|
||||||
|
/// New row version after the update, or the current version for a no-op.
|
||||||
|
#[prost(int64, tag = "4")]
|
||||||
|
pub row_version: i64,
|
||||||
|
}
|
||||||
/// One public option name. `value` identifies the option by its current public
|
/// One public option name. `value` identifies the option by its current public
|
||||||
/// alias and `alias` is its desired public alias; stored values remain internal.
|
/// alias and `alias` is its desired public alias; stored values remain internal.
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
@@ -1611,6 +1640,37 @@ pub mod table_definition_client {
|
|||||||
);
|
);
|
||||||
self.inner.unary(req, path, codec).await
|
self.inner.unary(req, path, codec).await
|
||||||
}
|
}
|
||||||
|
/// Changes whether one existing column is required. Enabling the requirement
|
||||||
|
/// is rejected while an active row has no value for the column.
|
||||||
|
pub async fn set_column_required(
|
||||||
|
&mut self,
|
||||||
|
request: impl tonic::IntoRequest<super::SetColumnRequiredRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SetColumnRequiredResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
> {
|
||||||
|
self.inner
|
||||||
|
.ready()
|
||||||
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
tonic::Status::unknown(
|
||||||
|
format!("Service was not ready: {}", e.into()),
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
let codec = tonic_prost::ProstCodec::default();
|
||||||
|
let path = http::uri::PathAndQuery::from_static(
|
||||||
|
"/komp_ac.table_definition.TableDefinition/SetColumnRequired",
|
||||||
|
);
|
||||||
|
let mut req = request.into_request();
|
||||||
|
req.extensions_mut()
|
||||||
|
.insert(
|
||||||
|
GrpcMethod::new(
|
||||||
|
"komp_ac.table_definition.TableDefinition",
|
||||||
|
"SetColumnRequired",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
self.inner.unary(req, path, codec).await
|
||||||
|
}
|
||||||
/// Replaces the optional user-visible aliases for a fixed-option column.
|
/// Replaces the optional user-visible aliases for a fixed-option column.
|
||||||
/// Stored values remain stable machine values and scripts never depend on labels.
|
/// Stored values remain stable machine values and scripts never depend on labels.
|
||||||
pub async fn set_column_option_aliases(
|
pub async fn set_column_option_aliases(
|
||||||
@@ -1855,6 +1915,15 @@ pub mod table_definition_server {
|
|||||||
tonic::Response<super::SetTableIndexesResponse>,
|
tonic::Response<super::SetTableIndexesResponse>,
|
||||||
tonic::Status,
|
tonic::Status,
|
||||||
>;
|
>;
|
||||||
|
/// Changes whether one existing column is required. Enabling the requirement
|
||||||
|
/// is rejected while an active row has no value for the column.
|
||||||
|
async fn set_column_required(
|
||||||
|
&self,
|
||||||
|
request: tonic::Request<super::SetColumnRequiredRequest>,
|
||||||
|
) -> std::result::Result<
|
||||||
|
tonic::Response<super::SetColumnRequiredResponse>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
/// Replaces the optional user-visible aliases for a fixed-option column.
|
/// Replaces the optional user-visible aliases for a fixed-option column.
|
||||||
/// Stored values remain stable machine values and scripts never depend on labels.
|
/// Stored values remain stable machine values and scripts never depend on labels.
|
||||||
async fn set_column_option_aliases(
|
async fn set_column_option_aliases(
|
||||||
@@ -2687,6 +2756,52 @@ pub mod table_definition_server {
|
|||||||
};
|
};
|
||||||
Box::pin(fut)
|
Box::pin(fut)
|
||||||
}
|
}
|
||||||
|
"/komp_ac.table_definition.TableDefinition/SetColumnRequired" => {
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
struct SetColumnRequiredSvc<T: TableDefinition>(pub Arc<T>);
|
||||||
|
impl<
|
||||||
|
T: TableDefinition,
|
||||||
|
> tonic::server::UnaryService<super::SetColumnRequiredRequest>
|
||||||
|
for SetColumnRequiredSvc<T> {
|
||||||
|
type Response = super::SetColumnRequiredResponse;
|
||||||
|
type Future = BoxFuture<
|
||||||
|
tonic::Response<Self::Response>,
|
||||||
|
tonic::Status,
|
||||||
|
>;
|
||||||
|
fn call(
|
||||||
|
&mut self,
|
||||||
|
request: tonic::Request<super::SetColumnRequiredRequest>,
|
||||||
|
) -> Self::Future {
|
||||||
|
let inner = Arc::clone(&self.0);
|
||||||
|
let fut = async move {
|
||||||
|
<T as TableDefinition>::set_column_required(&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 = SetColumnRequiredSvc(inner);
|
||||||
|
let codec = tonic_prost::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.table_definition.TableDefinition/SetColumnOptionAliases" => {
|
"/komp_ac.table_definition.TableDefinition/SetColumnOptionAliases" => {
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
struct SetColumnOptionAliasesSvc<T: TableDefinition>(pub Arc<T>);
|
struct SetColumnOptionAliasesSvc<T: TableDefinition>(pub Arc<T>);
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: 6dbaccc868...f43dc62578
Reference in New Issue
Block a user