Function get_meta_value

Source
pub async fn get_meta_value(pool: &Pool<MySql>, key: &str) -> Result<String>
Expand description

Retrieves a metadata value by its key.

This function performs a simple lookup in the metadata table to retrieve the value associated with the provided key.

§Arguments

  • pool - Database connection pool for executing the query
  • key - The unique key whose value to retrieve

§Returns

  • Ok(String) - Successfully retrieved the value for the key
  • Err(anyhow::Error) - Failed to fetch the value or key doesn’t exist

§Error Handling

Returns an error if the key doesn’t exist in the metadata table or if a database error occurs during the query execution.

§Concurrency

This function doesn’t acquire the metadata mutex since it only performs a read operation, which doesn’t risk data corruption.