Fix the SurrealKV scheme in the CLI (#3551)

This commit is contained in:
Rushmore Mushambi 2024-02-20 17:34:07 +02:00 committed by GitHub
parent b52d630c4b
commit 429ca31faa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ pub(crate) fn path_valid(v: &str) -> Result<String, String> {
v if v.starts_with("file:") => Ok(v.to_string()),
v if v.starts_with("rocksdb:") => Ok(v.to_string()),
v if v.starts_with("speedb:") => Ok(v.to_string()),
v if v.starts_with("surrealkv:") => Ok(v.to_string()),
v if v.starts_with("tikv:") => Ok(v.to_string()),
v if v.starts_with("fdb:") => Ok(v.to_string()),
_ => Err(String::from("Provide a valid database path parameter")),
@ -45,9 +46,8 @@ pub(crate) fn endpoint_valid(v: &str) -> Result<String, String> {
let scheme = split_endpoint(v).0;
match scheme {
"http" | "https" | "ws" | "wss" | "fdb" | "mem" | "rocksdb" | "file" | "tikv" => {
Ok(v.to_string())
}
"http" | "https" | "ws" | "wss" | "fdb" | "mem" | "rocksdb" | "speedb" | "surrealkv"
| "file" | "tikv" => Ok(v.to_string()),
_ => Err(String::from("Provide a valid database connection string")),
}
}