mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-23 01:44:33 +01:00
This PR implements a `VFS` module for our extension library, allowing extensions to be written that can introduce different I/O back-ends. EDIT: there is an included plain external/sync vfs example for testing, as mentioned in #996 they can be combined after they are both merged and we can keep 1 extension crate just for testing that features can be added to, without making a new extension just to test stuff. This PR also adds the `.vfslist` dot command, and replaces the `--io` CLI argument with `--vfs` to match sqlite. In order to support building vfs modules at compile time, and to then support opening a brand new db file using a staticly built-in extension module, a new method was created `open_with_vfs` that will load any vfs modules before a `Database` is created, and uses that `IO` to create the initial file, and returns it: `Result<(Arc<dyn IO>, Arc<Database>)>`. in keeping with the API of core. When #1039 is merged, the vfs module can be specified in a query parameter. Closes #960