mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
This reverts commit 29abc8f4ec.
This commit is contained in:
parent
4f1ac4d58f
commit
2e96af2a1b
2 changed files with 0 additions and 42 deletions
|
|
@ -89,10 +89,6 @@ pub async fn command(args: Args, _json: bool) -> Result<()> {
|
|||
Some(DatabaseType::PostgreSQL)
|
||||
} else if image.contains("redis") {
|
||||
Some(DatabaseType::Redis)
|
||||
} else if image.contains("keydb") {
|
||||
Some(DatabaseType::KeyDB)
|
||||
} else if image.contains("valkey") {
|
||||
Some(DatabaseType::Valkey)
|
||||
} else if image.contains("mongo") {
|
||||
Some(DatabaseType::MongoDB)
|
||||
} else if image.contains("mysql") {
|
||||
|
|
@ -128,8 +124,6 @@ fn get_connect_command(
|
|||
match &database_type {
|
||||
DatabaseType::PostgreSQL => get_postgres_command(&variables),
|
||||
DatabaseType::Redis => get_redis_command(&variables),
|
||||
DatabaseType::KeyDB => get_keydb_command(&variables),
|
||||
DatabaseType::Valkey => get_valkey_command(&variables),
|
||||
DatabaseType::MongoDB => get_mongo_command(&variables),
|
||||
DatabaseType::MySQL => get_mysql_command(&variables),
|
||||
}
|
||||
|
|
@ -171,38 +165,6 @@ fn get_redis_command(variables: &BTreeMap<String, String>) -> Result<(String, Ve
|
|||
Ok(("redis-cli".to_string(), vec!["-u".to_string(), connect_url]))
|
||||
}
|
||||
|
||||
fn get_keydb_command(variables: &BTreeMap<String, String>) -> Result<(String, Vec<String>)> {
|
||||
let connect_url = variables
|
||||
.get("KEYDB_PUBLIC_URL")
|
||||
.or_else(|| variables.get("KEYDB_URL"))
|
||||
.map(|s| s.to_string())
|
||||
.ok_or(RailwayError::ConnectionVariableNotFound(
|
||||
"KEYDB_PUBLIC_URL".to_string(),
|
||||
))?;
|
||||
|
||||
if !host_is_tcp_proxy(connect_url.clone()) {
|
||||
return Err(RailwayError::InvalidConnectionVariable.into());
|
||||
}
|
||||
|
||||
Ok(("redis-cli".to_string(), vec!["-u".to_string(), connect_url]))
|
||||
}
|
||||
|
||||
fn get_valkey_command(variables: &BTreeMap<String, String>) -> Result<(String, Vec<String>)> {
|
||||
let connect_url = variables
|
||||
.get("VALKEY_PUBLIC_URL")
|
||||
.or_else(|| variables.get("VALKEY_URL"))
|
||||
.map(|s| s.to_string())
|
||||
.ok_or(RailwayError::ConnectionVariableNotFound(
|
||||
"VALKEY_PUBLIC_URL".to_string(),
|
||||
))?;
|
||||
|
||||
if !host_is_tcp_proxy(connect_url.clone()) {
|
||||
return Err(RailwayError::InvalidConnectionVariable.into());
|
||||
}
|
||||
|
||||
Ok(("redis-cli".to_string(), vec!["-u".to_string(), connect_url]))
|
||||
}
|
||||
|
||||
fn get_mongo_command(variables: &BTreeMap<String, String>) -> Result<(String, Vec<String>)> {
|
||||
let connect_url = variables
|
||||
.get("MONGO_PUBLIC_URL")
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ pub enum DatabaseType {
|
|||
PostgreSQL,
|
||||
MySQL,
|
||||
Redis,
|
||||
KeyDB,
|
||||
Valkey,
|
||||
MongoDB,
|
||||
}
|
||||
|
||||
|
|
@ -17,8 +15,6 @@ impl DatabaseType {
|
|||
DatabaseType::PostgreSQL => "postgres",
|
||||
DatabaseType::MySQL => "mysql",
|
||||
DatabaseType::Redis => "redis",
|
||||
DatabaseType::KeyDB => "keydb",
|
||||
DatabaseType::Valkey => "valkey",
|
||||
DatabaseType::MongoDB => "mongo",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue