-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/28/2011 11:59 AM, Robert Hairgrove wrote:
> I'm only beginning to delve into the possibilities offered by the VFS
> API in SQLite. However, from what I have seen so far, it seems like a
> very complete abstraction to me.

For one thing a SQLite database at runtime is actually multiple related
files which makes things complicated.  Things like their names matter.  The
existing VFS implementation assumes you will be working with names while the
Chromium folk want a child process to not have permissions to open files and
instead have a supervisor process do so as appropriate.  The VFS API never
anticipated this split process model passing handles rather than file/pathnames.

> Why is it not possible to create a custom VFS for the intended purpose
> and register it for the connections that need it?

Because that custom VFS would be an almost duplicate of the existing VFS but
with a few key places changed.

If the changes were at the granularity of the VFS methods then it would be
no problem to "inherit" as needed.  Unfortunately they are within - for
example wanting to use the xOpen method but changing only the open() call
within.

unixOpen() is 235 lines of code plus several helper functions.  Having to
copy all that code just to change one call on one line is not sustainable in
the long term.

It would be possible to remote the VFS instead - ie have a an implementation
in the child process that just forwards all calls to the supervisor parent.
 If parent and child are using the same version of SQLite then this should
work well at the expense of adding latency.  It would however require the
parent to implement security and resource limiting.  The operating system
does that for "free" for child processes appropriately initialized.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1sB70ACgkQmOOfHg372QTFkwCgioqwaibI+6WrMedG4L0KOPKJ
E5UAoLXUimQ3sLncdOiJL2Gbb+Nouvzb
=NonM
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to