Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Factors] Integrate pg & mysql into trigger2 #2743

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions crates/runtime-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ spin-factor-key-value-azure = { path = "../factor-key-value-azure" }
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
14 changes: 14 additions & 0 deletions crates/runtime-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ 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;
use spin_factor_outbound_redis::OutboundRedisFactor;
use spin_factor_sqlite::runtime_config::spin as sqlite;
use spin_factor_sqlite::SqliteFactor;
Expand Down Expand Up @@ -159,6 +161,18 @@ impl FactorRuntimeConfigSource<VariablesFactor> for TomlRuntimeConfigSource<'_>
}
}

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

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
2 changes: 2 additions & 0 deletions crates/trigger2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spin-factor-key-value = { path = "../factor-key-value" }
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
6 changes: 6 additions & 0 deletions crates/trigger2/src/factors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ 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;
use spin_factor_sqlite::SqliteFactor;
use spin_factor_variables::VariablesFactor;
Expand All @@ -21,6 +23,8 @@ pub struct TriggerFactors {
pub sqlite: SqliteFactor,
pub redis: OutboundRedisFactor,
pub mqtt: OutboundMqttFactor,
pub pg: OutboundPgFactor,
pub mysql: OutboundMysqlFactor,
}

impl TriggerFactors {
Expand All @@ -39,6 +43,8 @@ impl TriggerFactors {
sqlite: SqliteFactor::new(default_sqlite_label_resolver),
redis: OutboundRedisFactor::new(),
mqtt: OutboundMqttFactor::new(NetworkedMqttClient::creator()),
pg: OutboundPgFactor::new(),
mysql: OutboundMysqlFactor::new(),
}
}
}
Expand Down
Loading