mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-01 23:44:19 +01:00
Add fn read_header() to DatabaseStorage trait
This commit is contained in:
@@ -473,6 +473,15 @@ impl DatabaseFile {
|
||||
}
|
||||
|
||||
impl turso_core::DatabaseStorage for DatabaseFile {
|
||||
fn read_header(&self, c: turso_core::Completion) -> turso_core::Result<turso_core::Completion> {
|
||||
let r = c.as_read();
|
||||
let size = r.buf().len();
|
||||
assert!(
|
||||
size == 100,
|
||||
"the size of the database header must be 100 bytes, got {size}"
|
||||
);
|
||||
self.file.pread(0, c)
|
||||
}
|
||||
fn read_page(
|
||||
&self,
|
||||
page_idx: usize,
|
||||
|
||||
Reference in New Issue
Block a user