expose freepage_list in pager

This commit is contained in:
bit-aloo
2025-08-11 09:57:46 +05:30
parent efd6fde389
commit cf12c90428

View File

@@ -1625,6 +1625,12 @@ impl Pager {
Ok(checkpoint_result)
}
pub fn freepage_list(&self) -> u32 {
self.io
.block(|| HeaderRefMut::from_pager(self))
.map(|header_ref| header_ref.borrow_mut().freelist_pages.into())
.unwrap_or(0)
}
// Providing a page is optional, if provided it will be used to avoid reading the page from disk.
// This is implemented in accordance with sqlite freepage2() function.
#[instrument(skip_all, level = Level::DEBUG)]