Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqld/proto/proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package proxy;
message Queries {
repeated Query queries = 1;
// Uuid
bytes clientId = 2;
string clientId = 2;
}

message Query {
Expand Down
2 changes: 1 addition & 1 deletion sqld/src/database/write_proxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Database for WriteProxyDatabase {
})
})
.collect::<Result<Vec<_>>>()?,
client_id: self.client_id.as_bytes().to_vec(),
client_id: self.client_id.to_string(),
};
let mut client = self.write_proxy.clone();
match client.execute(queries).await {
Expand Down
3 changes: 2 additions & 1 deletion sqld/src/rpc/proxy.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::HashMap;
use std::str::FromStr;

use async_lock::{RwLock, RwLockUpgradableReadGuard};
use uuid::Uuid;
Expand Down Expand Up @@ -167,7 +168,7 @@ where
req: tonic::Request<Queries>,
) -> Result<tonic::Response<ExecuteResults>, tonic::Status> {
let Queries { client_id, queries } = req.into_inner();
let client_id = Uuid::from_slice(&client_id).unwrap();
let client_id = Uuid::from_str(&client_id).unwrap();

let lock = self.clients.upgradable_read().await;
let db = match lock.get(&client_id) {
Expand Down