Allow to set shard and set sharding key without quotes (#43)

* Allow to set shard and set sharding key without quotes

* cover it

* dont look for these in the middle of another query

* friendly regex

* its own response to set shard key
This commit is contained in:
Lev Kokotov
2022-02-24 12:16:24 -08:00
committed by GitHub
parent 5972b6fa52
commit a784883611
2 changed files with 78 additions and 12 deletions

View File

@@ -229,11 +229,17 @@ impl Client {
}
}
Some((Command::SetShard, _)) | Some((Command::SetShardingKey, _)) => {
Some((Command::SetShard, _)) => {
custom_protocol_response_ok(&mut self.write, &format!("SET SHARD")).await?;
continue;
}
Some((Command::SetShardingKey, _)) => {
custom_protocol_response_ok(&mut self.write, &format!("SET SHARDING KEY"))
.await?;
continue;
}
Some((Command::SetServerRole, _)) => {
custom_protocol_response_ok(&mut self.write, "SET SERVER ROLE").await?;
continue;