use reifydb_transaction::transaction::Transaction;
use tracing::{Span, field, instrument};
use super::RowShapeRegistry;
use crate::{Result, store::row_shape::find::load_all_row_shapes};
pub struct RowShapeRegistryLoader;
impl RowShapeRegistryLoader {
#[instrument(
name = "row_shape_registry::load_all",
level = "debug",
skip(rx, registry),
fields(shape_count = field::Empty)
)]
pub fn load_all(rx: &mut Transaction<'_>, registry: &RowShapeRegistry) -> Result<()> {
let shapes = load_all_row_shapes(rx)?;
Span::current().record("shape_count", shapes.len());
for shape in shapes {
registry.cache_row_shape(shape);
}
Ok(())
}
}