Skip to content

Commit

Permalink
Merge pull request #2777 from fermyon/sqlite-cleanups
Browse files Browse the repository at this point in the history
Sqlite Cleanup
  • Loading branch information
rylev authored Aug 29, 2024
2 parents 4e0ee4d + 3957b29 commit 756f3d1
Show file tree
Hide file tree
Showing 15 changed files with 258 additions and 570 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

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

13 changes: 1 addition & 12 deletions crates/factor-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,15 @@ async-trait = "0.1"
serde = { version = "1.0", features = ["rc"] }
spin-factors = { path = "../factors" }
spin-locked-app = { path = "../locked-app" }
spin-sqlite = { path = "../sqlite", optional = true }
spin-sqlite-inproc = { path = "../sqlite-inproc", optional = true }
spin-sqlite-libsql = { path = "../sqlite-libsql", optional = true }
spin-world = { path = "../world" }
table = { path = "../table" }
tokio = "1"
toml = "0.8"

[dev-dependencies]
spin-factors-test = { path = "../factors-test" }
spin-sqlite = { path = "../sqlite" }
tokio = { version = "1", features = ["macros", "rt"] }

[features]
default = ["spin-cli"]
# Includes the runtime configuration handling used by the Spin CLI
spin-cli = [
"dep:spin-sqlite",
"dep:spin-sqlite-inproc",
"dep:spin-sqlite-libsql",
]

[lints]
workspace = true
3 changes: 0 additions & 3 deletions crates/factor-sqlite/src/runtime_config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#[cfg(feature = "spin-cli")]
pub mod spin;

use std::{collections::HashMap, sync::Arc};

use crate::ConnectionCreator;
Expand Down
262 changes: 0 additions & 262 deletions crates/factor-sqlite/src/runtime_config/spin.rs

This file was deleted.

3 changes: 2 additions & 1 deletion crates/factor-sqlite/tests/factor_test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use std::{collections::HashSet, sync::Arc};

use spin_factor_sqlite::{runtime_config::spin::RuntimeConfigResolver, SqliteFactor};
use spin_factor_sqlite::SqliteFactor;
use spin_factors::{
anyhow::{self, bail, Context},
runtime_config::toml::TomlKeyTracker,
Factor, FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer, RuntimeFactors,
};
use spin_factors_test::{toml, TestEnvironment};
use spin_sqlite::RuntimeConfigResolver;

#[derive(RuntimeFactors)]
struct TestFactors {
Expand Down
1 change: 1 addition & 0 deletions crates/runtime-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spin-factor-sqlite = { path = "../factor-sqlite" }
spin-factor-variables = { path = "../factor-variables" }
spin-factor-wasi = { path = "../factor-wasi" }
spin-factors = { path = "../factors" }
spin-sqlite = { path = "../sqlite" }
toml = "0.8"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/runtime-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ 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;
use spin_factor_variables::{spin_cli as variables, VariablesFactor};
use spin_factor_wasi::WasiFactor;
use spin_factors::runtime_config::toml::GetTomlValue as _;
use spin_factors::{
runtime_config::toml::TomlKeyTracker, FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer,
};
use spin_sqlite as sqlite;

/// The default state directory for the trigger.
pub const DEFAULT_STATE_DIR: &str = ".spin";
Expand Down
Loading

0 comments on commit 756f3d1

Please sign in to comment.