jiff for table definition added
This commit is contained in:
2
client
2
client
Submodule client updated: 0fd324cf74...9c8ae0b6fa
@@ -8,6 +8,7 @@ service AuthService {
|
||||
rpc Register(RegisterRequest) returns (AuthResponse);
|
||||
rpc Login(LoginRequest) returns (LoginResponse);
|
||||
rpc GetAuthorization(GetAuthorizationRequest) returns (AuthorizationSnapshot);
|
||||
rpc SetTimezone(SetTimezoneRequest) returns (UserPreferences);
|
||||
}
|
||||
|
||||
message RegisterRequest {
|
||||
@@ -38,6 +39,15 @@ message LoginResponse {
|
||||
string role = 5; // User's role
|
||||
string username = 6;
|
||||
AuthorizationSnapshot authorization = 7;
|
||||
string timezone = 8;
|
||||
}
|
||||
|
||||
message SetTimezoneRequest {
|
||||
string timezone = 1; // IANA timezone, for example Europe/Bratislava
|
||||
}
|
||||
|
||||
message UserPreferences {
|
||||
string timezone = 1;
|
||||
}
|
||||
|
||||
message GetAuthorizationRequest {}
|
||||
|
||||
@@ -120,11 +120,16 @@ message ColumnDefinition {
|
||||
// Logical column type. Supported values (case-insensitive):
|
||||
// TEXT
|
||||
// BOOLEAN
|
||||
// TIMESTAMPTZ
|
||||
// INSTANT (absolute timestamp, displayed in the viewer timezone)
|
||||
// USER_DATETIME (local input resolved in the user's timezone)
|
||||
// RAW_DATETIME (timezone-free civil datetime)
|
||||
// TIME (timezone-free time of day)
|
||||
// MONEY (= unconstrained NUMERIC; currency comes from the table)
|
||||
// INT
|
||||
// BIGINT
|
||||
// DATE
|
||||
// DURATION
|
||||
// PERIOD
|
||||
// DECIMAL(p,s) → NUMERIC(p,s)
|
||||
// DECIMAL args must be integers (no sign, no dot, no leading zeros);
|
||||
// s ≤ p and p ≥ 1.
|
||||
|
||||
Binary file not shown.
@@ -56,6 +56,19 @@ pub struct LoginResponse {
|
||||
pub username: ::prost::alloc::string::String,
|
||||
#[prost(message, optional, tag = "7")]
|
||||
pub authorization: ::core::option::Option<AuthorizationSnapshot>,
|
||||
#[prost(string, tag = "8")]
|
||||
pub timezone: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct SetTimezoneRequest {
|
||||
/// IANA timezone, for example Europe/Bratislava
|
||||
#[prost(string, tag = "1")]
|
||||
pub timezone: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct UserPreferences {
|
||||
#[prost(string, tag = "1")]
|
||||
pub timezone: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetAuthorizationRequest {}
|
||||
@@ -230,6 +243,30 @@ pub mod auth_service_client {
|
||||
.insert(GrpcMethod::new("komp_ac.auth.AuthService", "GetAuthorization"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
pub async fn set_timezone(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::SetTimezoneRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::UserPreferences>,
|
||||
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.auth.AuthService/SetTimezone",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("komp_ac.auth.AuthService", "SetTimezone"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Generated server implementations.
|
||||
@@ -260,6 +297,10 @@ pub mod auth_service_server {
|
||||
tonic::Response<super::AuthorizationSnapshot>,
|
||||
tonic::Status,
|
||||
>;
|
||||
async fn set_timezone(
|
||||
&self,
|
||||
request: tonic::Request<super::SetTimezoneRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::UserPreferences>, tonic::Status>;
|
||||
}
|
||||
#[derive(Debug)]
|
||||
pub struct AuthServiceServer<T> {
|
||||
@@ -470,6 +511,51 @@ pub mod auth_service_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.auth.AuthService/SetTimezone" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct SetTimezoneSvc<T: AuthService>(pub Arc<T>);
|
||||
impl<
|
||||
T: AuthService,
|
||||
> tonic::server::UnaryService<super::SetTimezoneRequest>
|
||||
for SetTimezoneSvc<T> {
|
||||
type Response = super::UserPreferences;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::SetTimezoneRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as AuthService>::set_timezone(&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 = SetTimezoneSvc(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)
|
||||
}
|
||||
_ => {
|
||||
Box::pin(async move {
|
||||
let mut response = http::Response::new(
|
||||
|
||||
@@ -82,11 +82,16 @@ pub struct ColumnDefinition {
|
||||
/// Logical column type. Supported values (case-insensitive):
|
||||
/// TEXT
|
||||
/// BOOLEAN
|
||||
/// TIMESTAMPTZ
|
||||
/// INSTANT (absolute timestamp, displayed in the viewer timezone)
|
||||
/// USER_DATETIME (local input resolved in the user's timezone)
|
||||
/// RAW_DATETIME (timezone-free civil datetime)
|
||||
/// TIME (timezone-free time of day)
|
||||
/// MONEY (= unconstrained NUMERIC; currency comes from the table)
|
||||
/// INT
|
||||
/// BIGINT
|
||||
/// DATE
|
||||
/// DURATION
|
||||
/// PERIOD
|
||||
/// DECIMAL(p,s) → NUMERIC(p,s)
|
||||
/// DECIMAL args must be integers (no sign, no dot, no leading zeros);
|
||||
/// s ≤ p and p ≥ 1.
|
||||
|
||||
2
server
2
server
Submodule server updated: 23f5feeaa1...cbbf1ac16b
Reference in New Issue
Block a user