Skip to content

SQLite: add preliminary support for Virtual File Systems #32178

@dsshep

Description

@dsshep

SQLite has a feature, Virtual File Systems, which allows more control over how SQLite interacts with the OS.

At the moment it is possible to register and use a vfs with Microsoft.Data.Sqlite. The native bindings that SqliteConnection relies on, SqlitePclRaw, has the methods (although not directly exposed) for registering, listing and unregistering a vfs.

However, managing which vfs a SqliteConnection is associated with is not currently possible. If you want a different vfs to be used, you must make it the default and therefore all connections will use it.

For now, if there was a way of passing the vfs name when the connection is being opened (e.g. in the connection string), it would be possible to open connections and pool them with a different vfs. The (involved) process of actually creating the vfs can be left up to the reader...

This had previously been suggested (#21797) and closed as no justification was given for it. There has also been some API discussion: #27986 (comment). I have also implemented a more up to date version of this in a fork https://github.com/dsshep/efcore/tree/sqlite-vfs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions