Skip to content

Commit

Permalink
Integrate mysql into trigger2
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <[email protected]>
  • Loading branch information
rylev committed Aug 22, 2024
1 parent bbf0a36 commit 337fdeb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/runtime-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spin-factor-outbound-http = { path = "../factor-outbound-http" }
spin-factor-outbound-mqtt = { path = "../factor-outbound-mqtt" }
spin-factor-outbound-networking = { path = "../factor-outbound-networking" }
spin-factor-outbound-pg = { path = "../factor-outbound-pg" }
spin-factor-outbound-mysql = { path = "../factor-outbound-mysql" }
spin-factor-outbound-redis = { path = "../factor-outbound-redis" }
spin-factor-sqlite = { path = "../factor-sqlite" }
spin-factor-variables = { path = "../factor-variables" }
Expand Down
7 changes: 7 additions & 0 deletions crates/runtime-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use spin_factor_key_value::runtime_config::spin::{self as key_value, MakeKeyValu
use spin_factor_key_value::{DefaultLabelResolver as _, KeyValueFactor};
use spin_factor_outbound_http::OutboundHttpFactor;
use spin_factor_outbound_mqtt::OutboundMqttFactor;
use spin_factor_outbound_mysql::OutboundMysqlFactor;
use spin_factor_outbound_networking::runtime_config::spin::SpinTlsRuntimeConfig;
use spin_factor_outbound_networking::OutboundNetworkingFactor;
use spin_factor_outbound_pg::OutboundPgFactor;
Expand Down Expand Up @@ -166,6 +167,12 @@ impl FactorRuntimeConfigSource<OutboundPgFactor> for TomlRuntimeConfigSource<'_>
}
}

impl FactorRuntimeConfigSource<OutboundMysqlFactor> for TomlRuntimeConfigSource<'_> {
fn get_runtime_config(&mut self) -> anyhow::Result<Option<()>> {
Ok(None)
}
}

impl FactorRuntimeConfigSource<OutboundRedisFactor> for TomlRuntimeConfigSource<'_> {
fn get_runtime_config(&mut self) -> anyhow::Result<Option<()>> {
Ok(None)
Expand Down
1 change: 1 addition & 0 deletions crates/trigger2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spin-factor-outbound-http = { path = "../factor-outbound-http" }
spin-factor-outbound-mqtt = { path = "../factor-outbound-mqtt" }
spin-factor-outbound-networking = { path = "../factor-outbound-networking" }
spin-factor-outbound-pg = { path = "../factor-outbound-pg" }
spin-factor-outbound-mysql = { path = "../factor-outbound-mysql" }
spin-factor-outbound-redis = { path = "../factor-outbound-redis" }
spin-factor-sqlite = { path = "../factor-sqlite" }
spin-factor-variables = { path = "../factor-variables" }
Expand Down
3 changes: 3 additions & 0 deletions crates/trigger2/src/factors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::PathBuf;
use spin_factor_key_value::KeyValueFactor;
use spin_factor_outbound_http::OutboundHttpFactor;
use spin_factor_outbound_mqtt::{NetworkedMqttClient, OutboundMqttFactor};
use spin_factor_outbound_mysql::OutboundMysqlFactor;
use spin_factor_outbound_networking::OutboundNetworkingFactor;
use spin_factor_outbound_pg::OutboundPgFactor;
use spin_factor_outbound_redis::OutboundRedisFactor;
Expand All @@ -23,6 +24,7 @@ pub struct TriggerFactors {
pub redis: OutboundRedisFactor,
pub mqtt: OutboundMqttFactor,
pub pg: OutboundPgFactor,
pub mysql: OutboundMysqlFactor,
}

impl TriggerFactors {
Expand All @@ -42,6 +44,7 @@ impl TriggerFactors {
redis: OutboundRedisFactor::new(),
mqtt: OutboundMqttFactor::new(NetworkedMqttClient::creator()),
pg: OutboundPgFactor::new(),
mysql: OutboundMysqlFactor::new(),
}
}
}
Expand Down

0 comments on commit 337fdeb

Please sign in to comment.