Skip to content

Commit

Permalink
Add CacheStatus::{WalCached,Unknown}
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Jul 17, 2023
1 parent e7f2500 commit 7258671
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/datasets/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,13 +879,16 @@ pub struct QueryStatus {
}

/// The cache status of the query.
#[derive(IntoPrimitive, TryFromPrimitive, Clone, Copy, Debug, PartialEq, Eq)]
#[derive(IntoPrimitive, TryFromPrimitive, Clone, Copy, Debug, PartialEq, Eq, Default)]
#[repr(u8)]
#[non_exhaustive]
pub enum CacheStatus {
Miss = 1,
Materialized = 2, // Filtered rows
Results = 4, // Aggregated and grouped records
WalCached = 9, // WAL is cached
#[default]
Unknown,
}

impl Serialize for CacheStatus {
Expand All @@ -903,7 +906,7 @@ impl<'de> Deserialize<'de> for CacheStatus {
D: Deserializer<'de>,
{
let value: u8 = Deserialize::deserialize(deserializer)?;
Self::try_from(value).map_err(serde::de::Error::custom)
Ok(Self::try_from(value).unwrap_or_default())
}
}

Expand Down

0 comments on commit 7258671

Please # to comment.