pub(crate) fn join_i64s(values: &[i64]) -> String {
    values
        .iter()
        .map(i64::to_string)
        .collect::<Vec<_>>()
        .join(", ")
}

pub(crate) fn current_time_micros() -> crate::Result<i64> {
    let micros = std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .map_err(|err| crate::StorageError::Backend(err.to_string()))?
        .as_micros();
    i64::try_from(micros)
        .map_err(|_| crate::StorageError::Backend("system time is out of range".into()))
}
