SQLite Forum

Using a VFS shim together with another user-specified VFS
Login
> You don't need unique names.

I doubt that that is true. The registered VFSes are members of a linked list, and function `sqlite3_vfs_find` uses this list to identify a VFS by name. If you have 2 or more VFSes with the same name, only the first in the list can be found.

> You unregister the original VFS (putting its VFS object in a private list), then give your shim clone the same name before registering it.

Ok, if the original VFS is no longer registered this will work. However, if there are other VFS shims involved, things could possibly become nasty.

> I keep thinking there is a supported way to get the list of all current VFS's, but it escapes me right now.

The SQLite shell command `vfslist` allows to walk through the list of registered VFSes.

It seems that all sorts of automatism in combining a VFS shim with existing VFSes could lead to weird effects. Most likely I will be better off to allow a user/developer to explicitly combine my VFS shim with a certain other underlying VFS and assign a new name of his/her choice to the combined VFS.