feature: add VFS safe wrapper#1797
Conversation
|
To be compared with |
|
WASM is not running properly. Any guidance on that would be appreciated as I never targeted any WASM target not in Rust or in any other language. Regarding other VFSs crates, please do compare. I think we are way ahead in:
But please share your feedback when you have some time. |
|
WASM is now compiling. I think that VFSs tests are not running though. |
I took a quick look, and your VFS uses some things that are not supported by wasm, such as WASM now uses memvfs. |
I decided for now to remove support for WASM. I do not have enough experience with it to sensibly deal with that and I think it would just make this PR even bigger. I think support can be added as a separate PR, once we are ok (or not!) with the interface proposed here. |
|
I tried to implement the windows |
|
Would it be better if I used something like |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1797 +/- ##
==========================================
- Coverage 87.69% 82.41% -5.29%
==========================================
Files 58 59 +1
Lines 10948 12309 +1361
==========================================
+ Hits 9601 10144 +543
- Misses 1347 2165 +818 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: kcza <ed@kcza.net> Co-authored-by: Alberto Carretero <angelalbertoc.r@gmail.com>
Subjournals are temporary files.
This PR adds a the ability to write custom VFSs by implementing few safe traits.
It uses a builder pattern similar #1770 to allow registering VFSs. This way it supports all three versions of the
sqlite3_fileAPI (base, WAL-mode, fetch).It has the following few limitations so far:
xSetSystemCall,xGetSystemCall,xNextSystemCall)xDlOpen,xDlError,xDlSym,xDlClose) are not implemented for WindowsPRAGMAfile control might allocate a bit more than necessary when returning valuesWe also wrote a simple in-memory VFS to showcase the usage of this wrapper. We were able to successfully test this in an internal tool at Canonical, where this work took place.
This should address #1145.