Added the patch and it appears to work correctly both when "in-line" and when used as a loadable extension. When building as a loadable extension you have to define SQLITE_HAVE_ZLIB and add the zlib library when linking. The latest code is here: <http://www.dessus.com/files/vsv.c> and the whole bunch are: <http://www.dessus.com/files/sqlite3extensions.zip>