Skip to content

Commit 2902c75

Browse files
committed
Ensure key-value metadata key is exposed for usage
Signed-off-by: Ryan Levick <[email protected]>
1 parent 99002e0 commit 2902c75

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

crates/factor-key-value/src/host.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
use crate::util::EmptyStoreManager;
22
use anyhow::{Context, Result};
33
use spin_core::{async_trait, wasmtime::component::Resource};
4-
use spin_locked_app::MetadataKey;
54
use spin_world::v2::key_value;
65
use std::{collections::HashSet, sync::Arc};
76
use table::Table;
87
use tracing::{instrument, Level};
98

10-
pub const KEY_VALUE_STORES_KEY: MetadataKey<Vec<String>> = MetadataKey::new("key_value_stores");
11-
129
const DEFAULT_STORE_TABLE_CAPACITY: u32 = 256;
1310

1411
pub use key_value::Error;

crates/factor-key-value/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ use std::{
88
};
99

1010
use anyhow::ensure;
11-
use host::KEY_VALUE_STORES_KEY;
1211
use spin_factors::{
1312
ConfigureAppContext, Factor, FactorInstanceBuilder, InitContext, PrepareContext, RuntimeFactors,
1413
};
14+
use spin_locked_app::MetadataKey;
1515
use util::DefaultManagerGetter;
1616

17+
/// Metadata key for key-value stores.
18+
pub const KEY_VALUE_STORES_KEY: MetadataKey<Vec<String>> = MetadataKey::new("key_value_stores");
1719
pub use host::{log_error, Error, KeyValueDispatch, Store, StoreManager};
1820
pub use runtime_config::RuntimeConfig;
1921
pub use util::{CachingStoreManager, DelegatingStoreManager};

crates/factor-sqlite/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ fn ensure_allowed_databases_are_configured(
135135
Ok(())
136136
}
137137

138+
/// Metadata key for a list of allowed databases for a component.
138139
pub const ALLOWED_DATABASES_KEY: MetadataKey<Vec<String>> = MetadataKey::new("databases");
139140

140141
/// Resolves a label to a default connection creator.

0 commit comments

Comments
 (0)