Add pwritev to wasm/js api

This commit is contained in:
PThorpe92
2025-07-25 19:05:52 -04:00
parent 7b2163208b
commit d189f66328
2 changed files with 12 additions and 2 deletions

View File

@@ -718,6 +718,15 @@ impl turso_core::DatabaseStorage for DatabaseFile {
let pos = (page_idx - 1) * size;
self.file.pwrite(pos, buffer, c)
}
fn write_pages(
&self,
_first_page_idx: usize,
_page_size: usize,
_buffers: Vec<Arc<RefCell<turso_core::Buffer>>>,
_c: turso_core::Completion,
) -> turso_core::Result<()> {
todo!();
}
fn sync(&self, c: turso_core::Completion) -> turso_core::Result<turso_core::Completion> {
self.file.sync(c)

View File

@@ -13,7 +13,7 @@ from typing import Dict
from cli_tests.console import error, info, test
from cli_tests.test_turso_cli import TestTursoShell
LIMBO_BIN = Path("./target/release/tursodb")
LIMBO_BIN = Path("./target/debug/tursodb")
DB_FILE = Path("testing/temp.db")
vfs_list = ["syscall"]
if platform.system() == "Linux":
@@ -79,11 +79,13 @@ def main() -> None:
averages: Dict[str, float] = {}
for vfs in vfs_list:
setup_temp_db()
test(f"\n### VFS: {vfs} ###")
times = bench_one(vfs, sql, iterations)
info(f"All times ({vfs}):", " ".join(f"{t:.6f}" for t in times))
avg = statistics.mean(times)
averages[vfs] = avg
cleanup_temp_db()
info("\n" + "-" * 60)
info("Average runtime per VFS")
@@ -106,7 +108,6 @@ def main() -> None:
faster_slower = "slower" if pct > 0 else "faster"
info(f"{vfs:<{name_pad}} : {avg:.6f} ({abs(pct):.1f}% {faster_slower} than {baseline})")
info("-" * 60)
cleanup_temp_db()
if __name__ == "__main__":