core: Open WAL file and parse header

This commit is contained in:
Pekka Enberg 2024-08-03 12:44:36 +03:00
parent ed4116e7c2
commit a290b2f102
3 changed files with 34 additions and 6 deletions

View file

@ -48,7 +48,8 @@ impl Database {
pub fn open_file(io: Arc<dyn crate::io::IO>, path: &str) -> Result<Database> {
let file = io.open_file(path)?;
let page_io = Rc::new(FileStorage::new(file));
let wal = Rc::new(WalFile::new());
let wal_path = format!("{}-wal", path);
let wal = Rc::new(WalFile::new(io.clone(), wal_path));
Self::open(io, page_io, wal)
}