dyedgreen / deno-sqlite

Deno SQLite module
https://deno.land/x/sqlite
MIT License
409 stars 36 forks source link

Exposing xCheckReservedLock and xSleep to the VFS implementation #243

Open fabiospampinato opened 1 year ago

fabiospampinato commented 1 year ago

I'm currently writing a VFS for Node, and I see that xCheckReservedLock and xSleep are basically no-ops in vfs.c, so I can't quite implement them in vfs.js.

I think it would be better to expose these at the vfs.js level, and making them no-ops there instead.

The idea is that in some scenarios they could be implemented (with Atomics.wait for example, or a native node module), and implementing them to my understanding could be beneficial (if a file is locked already then I think sqlite will sleep for a bit and check again, which seems better than always blocking when trying to get a lock).

dyedgreen commented 1 year ago

Implementing this might address #249