From 387d724959d7e0c58d78b753c436cd869d144ec1 Mon Sep 17 00:00:00 2001 From: Joshua Jerin Date: Mon, 12 Aug 2024 10:14:57 -0400 Subject: [PATCH] Update toml dependency and refactor Extension struct (#902) --- tembo-cli/Cargo.lock | 12 ++++++------ tembo-cli/Cargo.toml | 2 +- tembo-cli/src/cli/tembo_config.rs | 7 +------ tembo-cli/src/cmd/apply.rs | 4 ++-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tembo-cli/Cargo.lock b/tembo-cli/Cargo.lock index f897c90e4..73a036c9b 100644 --- a/tembo-cli/Cargo.lock +++ b/tembo-cli/Cargo.lock @@ -4713,9 +4713,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -4734,9 +4734,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap 2.3.0", "serde", @@ -5555,9 +5555,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] diff --git a/tembo-cli/Cargo.toml b/tembo-cli/Cargo.toml index 858580974..816afafb1 100644 --- a/tembo-cli/Cargo.toml +++ b/tembo-cli/Cargo.toml @@ -37,7 +37,7 @@ serde_yaml = "0.9.17" home = "0.5.5" semver = "1.0.18" mockall = "0.11.4" -toml = "0.7.6" +toml = "0.8.19" chrono = { version = "0.4.29", features = ["serde"] } simplelog = { version = "^0.12.1", features = ["paris"] } clerk-rs = "0.1.7" diff --git a/tembo-cli/src/cli/tembo_config.rs b/tembo-cli/src/cli/tembo_config.rs index 799d3074d..5f8594004 100644 --- a/tembo-cli/src/cli/tembo_config.rs +++ b/tembo-cli/src/cli/tembo_config.rs @@ -103,15 +103,10 @@ fn default_extensions() -> Option> { Some(HashMap::new()) } -fn default_as_true() -> bool { - true -} - #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct Extension { pub version: Option, - #[serde(default = "default_as_true")] - pub enabled: bool, + pub enabled: Option, pub trunk_project: Option, pub trunk_project_version: Option, } diff --git a/tembo-cli/src/cmd/apply.rs b/tembo-cli/src/cmd/apply.rs index eb5111abd..7adb29c4e 100644 --- a/tembo-cli/src/cmd/apply.rs +++ b/tembo-cli/src/cmd/apply.rs @@ -945,7 +945,7 @@ fn get_extensions( database: Some("postgres".to_string()), schema: None, version: version, - enabled: extension.enabled, + enabled: extension.enabled.unwrap_or(false), }]; vec_extensions.push(Extension { @@ -971,7 +971,7 @@ fn get_extensions_controller( database: String::new(), schema: None, version: None, - enabled: extension.enabled, + enabled: extension.enabled.unwrap_or(false), }); vec_extensions.push(ControllerExtension {