Skip to content

Commit

Permalink
support railway connect for timescale image (#466)
Browse files Browse the repository at this point in the history
* support `railway connect` for timescale image

* lowercase
  • Loading branch information
coffee-cup authored Nov 14, 2023
1 parent 975a01d commit 18e6272
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/commands/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ impl PluginOrService {
.and_then(|source| source.image)
.map(|image: String| image.to_lowercase())
.and_then(|image: String| {
if image.contains("postgres") {
if image.contains("postgres")
|| image.contains("postgis")
|| image.contains("timescale")
{
Some(PluginType::postgresql)
} else if image.contains("redis") {
Some(PluginType::redis)
Expand Down
10 changes: 4 additions & 6 deletions src/controllers/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ pub fn get_plugin_or_service(
.services
.edges
.iter()
.find(|edge| edge.node.name.to_lowercase() == service_or_plugin_name);
.find(|edge| edge.node.name.to_lowercase() == service_or_plugin_name.to_lowercase());

let plugin = project
.plugins
.edges
.iter()
.find(|edge| edge.node.friendly_name.to_lowercase() == service_or_plugin_name);
let plugin = project.plugins.edges.iter().find(|edge| {
edge.node.friendly_name.to_lowercase() == service_or_plugin_name.to_lowercase()
});

if let Some(service) = service {
return Ok(PluginOrService::Service(service.node.clone()));
Expand Down

0 comments on commit 18e6272

Please sign in to comment.