Skip to main content

ensure_system_value_if_missing

Function ensure_system_value_if_missing 

Source
pub async fn ensure_system_value_if_missing<C: ConnectionTrait>(
    db: &C,
    registry: &'static ConfigRegistry,
    key: &str,
    value: &str,
) -> Result<bool>
Expand description

Inserts one system value if no row exists.

The caller must validate the logical value and encode any secret before calling. value is persisted verbatim without structure, normalizer, or dependency validation. Unlike ensure_defaults, this function does not obtain a normalized value from default seed records.

ยงErrors

Returns an error when the database operation fails.