Skip to content

Commit 3957b29

Browse files
committed
Repurpose spin-sqlite crate
Signed-off-by: Ryan Levick <[email protected]>
1 parent f45599a commit 3957b29

File tree

12 files changed

+292
-298
lines changed

12 files changed

+292
-298
lines changed

Cargo.lock

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/factor-sqlite/Cargo.toml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,15 @@ async-trait = "0.1"
1313
serde = { version = "1.0", features = ["rc"] }
1414
spin-factors = { path = "../factors" }
1515
spin-locked-app = { path = "../locked-app" }
16-
spin-sqlite = { path = "../sqlite", optional = true }
17-
spin-sqlite-inproc = { path = "../sqlite-inproc", optional = true }
18-
spin-sqlite-libsql = { path = "../sqlite-libsql", optional = true }
1916
spin-world = { path = "../world" }
2017
table = { path = "../table" }
2118
tokio = "1"
2219
toml = "0.8"
2320

2421
[dev-dependencies]
2522
spin-factors-test = { path = "../factors-test" }
23+
spin-sqlite = { path = "../sqlite" }
2624
tokio = { version = "1", features = ["macros", "rt"] }
2725

28-
[features]
29-
default = ["spin-cli"]
30-
# Includes the runtime configuration handling used by the Spin CLI
31-
spin-cli = [
32-
"dep:spin-sqlite",
33-
"dep:spin-sqlite-inproc",
34-
"dep:spin-sqlite-libsql",
35-
]
36-
3726
[lints]
3827
workspace = true

crates/factor-sqlite/src/runtime_config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#[cfg(feature = "spin-cli")]
2-
pub mod spin;
3-
41
use std::{collections::HashMap, sync::Arc};
52

63
use crate::ConnectionCreator;

crates/factor-sqlite/src/runtime_config/spin.rs

Lines changed: 0 additions & 257 deletions
This file was deleted.

crates/factor-sqlite/tests/factor_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use std::{collections::HashSet, sync::Arc};
22

3-
use spin_factor_sqlite::{runtime_config::spin::RuntimeConfigResolver, SqliteFactor};
3+
use spin_factor_sqlite::SqliteFactor;
44
use spin_factors::{
55
anyhow::{self, bail, Context},
66
runtime_config::toml::TomlKeyTracker,
77
Factor, FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer, RuntimeFactors,
88
};
99
use spin_factors_test::{toml, TestEnvironment};
10+
use spin_sqlite::RuntimeConfigResolver;
1011

1112
#[derive(RuntimeFactors)]
1213
struct TestFactors {

crates/runtime-config/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spin-factor-sqlite = { path = "../factor-sqlite" }
2525
spin-factor-variables = { path = "../factor-variables" }
2626
spin-factor-wasi = { path = "../factor-wasi" }
2727
spin-factors = { path = "../factors" }
28+
spin-sqlite = { path = "../sqlite" }
2829
toml = "0.8"
2930

3031
[lints]

crates/runtime-config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use spin_factor_outbound_networking::runtime_config::spin::SpinTlsRuntimeConfig;
1212
use spin_factor_outbound_networking::OutboundNetworkingFactor;
1313
use spin_factor_outbound_pg::OutboundPgFactor;
1414
use spin_factor_outbound_redis::OutboundRedisFactor;
15-
use spin_factor_sqlite::runtime_config::spin as sqlite;
1615
use spin_factor_sqlite::SqliteFactor;
1716
use spin_factor_variables::{spin_cli as variables, VariablesFactor};
1817
use spin_factor_wasi::WasiFactor;
1918
use spin_factors::runtime_config::toml::GetTomlValue as _;
2019
use spin_factors::{
2120
runtime_config::toml::TomlKeyTracker, FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer,
2221
};
22+
use spin_sqlite as sqlite;
2323

2424
/// The default state directory for the trigger.
2525
pub const DEFAULT_STATE_DIR: &str = ".spin";

crates/sqlite-inproc/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ edition = { workspace = true }
66

77
[dependencies]
88
anyhow = "1.0"
9-
async-trait = "0.1.68"
9+
async-trait = "0.1"
1010
once_cell = "1"
1111
rand = "0.8"
1212
rusqlite = { version = "0.29.0", features = ["bundled"] }
13-
spin-sqlite = { path = "../sqlite" }
13+
spin-factor-sqlite = { path = "../factor-sqlite" }
1414
spin-world = { path = "../world" }
1515
tokio = "1"
1616
tracing = { workspace = true }

0 commit comments

Comments
 (0)