Skip to content
Draft
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
49fe0d2
Upgraded System.Data.SQLite to 1.0.119 tree-wide
nickshulman Jul 15, 2026
b1cc598
Added zip random-access foundation and the open-from-zip safety gate
nickshulman Jul 15, 2026
f3af2e3
Added AreEntriesStored open-in-place detection to RandomAccessZipFile
nickshulman Jul 15, 2026
7411a66
Stored .skyd and .blib uncompressed when sharing a document
nickshulman Jul 15, 2026
7a9d48d
Added FilePath, a zip-aware path type for files inside a .zip
nickshulman Jul 15, 2026
7ab23f0
Read the .skyd from an in-place .sky.zip via FilePath
nickshulman Jul 15, 2026
9b899d5
Read the .sky through FilePath so it can live in an in-place .sky.zip
nickshulman Jul 15, 2026
625acb8
Added the zipvfs SQLite extension and the open-in-place criterion
nickshulman Jul 15, 2026
cf3f35d
Opened .blib spectral libraries in place from a .sky.zip via the zipv…
nickshulman Jul 15, 2026
129d0e3
Updated the SQLite interop to 1.0.119 inside vendor_api_ABI.7z
nickshulman Jul 15, 2026
d630099
Opened .sky.zip documents in place through the load pipeline
nickshulman Jul 16, 2026
ac47b07
Added a functional test for opening a document in place from a .sky.zip
nickshulman Jul 16, 2026
0f95b6b
Prompted to extract when saving a document opened in place from a .sk…
nickshulman Jul 16, 2026
5104023
Built zipvfs_ext.dll from source instead of committing a prebuilt binary
nickshulman Jul 16, 2026
98bad3a
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 16, 2026
c3c7bc1
Made the byte-range VFS extension generic instead of zip-specific
nickshulman Jul 16, 2026
04357a5
Renamed the byte-range VFS extension to slicevfs
nickshulman Jul 16, 2026
43cdd0b
Addressed Copilot review feedback on the open-from-zip PR
nickshulman Jul 16, 2026
f526fa8
Detected the .zip container extension case-insensitively
nickshulman Jul 16, 2026
cbcc3a6
Reported "Storing" vs "Compressing" and split the open-in-place exten…
nickshulman Jul 16, 2026
ae556f0
Moved FilePath and the zip byte-range VFS into the Common project
nickshulman Jul 16, 2026
d71417f
Opened a background proteome (.protdb) in place from a .sky.zip
nickshulman Jul 16, 2026
676f788
Extracted a .sky.zip without prompting when its files must be on disk
nickshulman Jul 16, 2026
8565c05
Closed streams which are opened for a document that is no longer current
nickshulman Jul 16, 2026
8f29f38
Closed the streams of a document replaced in a MemoryDocumentContainer
nickshulman Jul 16, 2026
b75d0b0
Reverted the System.Data.SQLite 1.0.119 upgrade
nickshulman Jul 16, 2026
86a65d2
Read and re-shared a big .sky.zip without holding it in memory
nickshulman Jul 17, 2026
f8889c4
Renamed ByteRangeStream to SliceStream
nickshulman Jul 17, 2026
d5a0677
Checked whether a .sky.zip can be opened in place in SrmDocumentSharing
nickshulman Jul 17, 2026
0767cd7
Simplified how CanOpenInPlace classifies the entries of a .sky.zip
nickshulman Jul 17, 2026
0358477
Merge remote-tracking branch 'origin/master' into Skyline/work/202607…
nickshulman Jul 17, 2026
61ac1f3
Fix code inspection. Revert multithreading in StructSerializer.
nickshulman Jul 17, 2026
e0b5fc7
Fix code inspection
nickshulman Jul 18, 2026
c75dc4f
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 18, 2026
b504960
Fix line endings
nickshulman Jul 18, 2026
d6b34bc
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 21, 2026
ab60153
Rename RandomAccessZipFile to ZipFileReader
nickshulman Jul 21, 2026
94d6f2d
Fix build
nickshulman Jul 21, 2026
318b99b
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 21, 2026
17c8ce8
Add diagnostics to TestDiannSearchTutorial
nickshulman Jul 22, 2026
e0e1097
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 22, 2026
fbd7413
Merge branch 'master' of https://github.com/ProteoWizard/pwiz into Sk…
nickshulman Jul 24, 2026
5a6b876
Merge branch 'master' into Skyline/work/20260715_open_doc_from_zip
nickshulman Jul 24, 2026
4f37ae0
Merge branch 'master' into Skyline/work/20260715_open_doc_from_zip
nickshulman Aug 8, 2026
24c6356
Merge branch 'master' into Skyline/work/20260715_open_doc_from_zip
nickshulman Aug 17, 2026
3aff623
Merge branch 'master' into Skyline/work/20260715_open_doc_from_zip
nickshulman Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libraries/SQLite/Jamfile.jam
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ rule sqlite3-usage-requirements ( properties * )
lib sqlite3 : sqlite3.c : <conditional>@sqlite3-requirements <link>static : : <conditional>@sqlite3-usage-requirements <include>$(THIS_PATH) ;
lib sqlite3pp : sqlite3pp.cpp sqlite3 : <include>$(THIS_PATH) <link>static : : <conditional>@sqlite3-usage-requirements <include>$(THIS_PATH) ;

# Loadable SQLite extension DLL providing the read-only "slicevfs" offset VFS, which exposes a
# slice of a file's bytes (given an offset and length) as a database, e.g. to open a database
# stored uncompressed at a byte range inside a larger container file in place. It registers via the
# extension api-routines table, so it does NOT link sqlite3. Built as a shared library; the
# exported entry point is sqlite3_slicevfs_init. The Skyline build installs this next to
# SQLite.Interop.dll (see the install-slicevfs rule in pwiz_tools/Skyline/Jamfile.jam) and
# copies it into the output.
lib slicevfs : slicevfs.c : <link>shared <include>$(THIS_PATH) : : <include>$(THIS_PATH) ;

#exe sqlite : shell.c : <library>sqlite3 <link>static ;
112 changes: 112 additions & 0 deletions libraries/SQLite/slicevfs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
** slicevfs.c - a SQLite loadable extension that registers a read-only "offset shim" VFS named
** "slicevfs". It opens the underlying real file through the default VFS but adds a base byte-offset
** to every read, so a database that is stored at an offset inside a larger container file can be
** opened in place, exposing only the slice of the container's bytes given by an offset and length.
**
** The base offset and length are passed as URI parameters:
** file:///C:/container?ofs=NNN&len=NNN&vfs=slicevfs
** (len omitted or 0 means "to the end of the container file").
**
** Registration uses the sqlite3_api_routines table handed to the extension's init function, so
** it works regardless of how the host SQLite's symbols are exported. This is why a loadable
** extension is used instead of P/Invoking sqlite3_vfs_register directly: the System.Data.SQLite
** interop only exports hashed symbol names, and does not export sqlite3_vfs_register at all.
**
** IMPORTANT: the host must keep this DLL loaded for as long as the VFS is registered - the
** registered sqlite3_vfs struct and these functions live inside this DLL.
*/
#include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1
#include <string.h>

typedef struct SliceFile SliceFile;
struct SliceFile {
sqlite3_file base; /* IO methods; must be first */
sqlite3_file *pReal; /* underlying file opened via the default VFS */
sqlite3_int64 ofs; /* base offset of the database inside the container */
sqlite3_int64 len; /* length of the database */
};

static sqlite3_vfs *gRoot; /* the default VFS we delegate to */

static int slClose(sqlite3_file *pFile){
SliceFile *p = (SliceFile*)pFile;
int rc = SQLITE_OK;
if( p->pReal && p->pReal->pMethods ) rc = p->pReal->pMethods->xClose(p->pReal);
if( p->pReal ) sqlite3_free(p->pReal);
p->pReal = 0;
return rc;
}
static int slRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite3_int64 iOfst){
SliceFile *p = (SliceFile*)pFile;
return p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, p->ofs + iOfst);
}
static int slWrite(sqlite3_file *pFile, const void *z, int n, sqlite3_int64 o){ (void)pFile;(void)z;(void)n;(void)o; return SQLITE_READONLY; }
static int slTruncate(sqlite3_file *pFile, sqlite3_int64 size){ (void)pFile;(void)size; return SQLITE_READONLY; }
static int slSync(sqlite3_file *pFile, int flags){ (void)pFile;(void)flags; return SQLITE_OK; }
static int slFileSize(sqlite3_file *pFile, sqlite3_int64 *pSize){ *pSize = ((SliceFile*)pFile)->len; return SQLITE_OK; }
static int slLock(sqlite3_file *pFile, int e){ (void)pFile;(void)e; return SQLITE_OK; }
static int slUnlock(sqlite3_file *pFile, int e){ (void)pFile;(void)e; return SQLITE_OK; }
static int slCheckReservedLock(sqlite3_file *pFile, int *pResOut){ (void)pFile; *pResOut = 0; return SQLITE_OK; }
static int slFileControl(sqlite3_file *pFile, int op, void *pArg){ (void)pFile;(void)op;(void)pArg; return SQLITE_NOTFOUND; }
static int slSectorSize(sqlite3_file *pFile){ (void)pFile; return 4096; }
static int slDeviceCharacteristics(sqlite3_file *pFile){ (void)pFile; return SQLITE_IOCAP_IMMUTABLE; }

static const sqlite3_io_methods slIoMethods = {
1, /* iVersion */
slClose, slRead, slWrite, slTruncate, slSync, slFileSize,
slLock, slUnlock, slCheckReservedLock, slFileControl,
slSectorSize, slDeviceCharacteristics
};

static int slOpen(sqlite3_vfs *pVfs, const char *zName, sqlite3_file *pFile,
int flags, int *pOutFlags){
SliceFile *p = (SliceFile*)pFile;
int rc;
(void)pVfs;
memset(p, 0, sizeof(*p));
p->ofs = sqlite3_uri_int64(zName, "ofs", 0);
p->len = sqlite3_uri_int64(zName, "len", 0);
p->pReal = (sqlite3_file*)sqlite3_malloc(gRoot->szOsFile);
if( p->pReal==0 ) return SQLITE_NOMEM;
memset(p->pReal, 0, gRoot->szOsFile);
rc = gRoot->xOpen(gRoot, zName, p->pReal,
(flags & ~SQLITE_OPEN_READWRITE) | SQLITE_OPEN_READONLY, pOutFlags);
if( rc!=SQLITE_OK ){ sqlite3_free(p->pReal); p->pReal = 0; return rc; }
if( p->len==0 ){
sqlite3_int64 sz = 0;
p->pReal->pMethods->xFileSize(p->pReal, &sz);
p->len = sz - p->ofs; /* to the end of the container */
}
p->base.pMethods = &slIoMethods;
return SQLITE_OK;
}

/* These delegate to the default VFS (passing gRoot explicitly). */
static int slFullPathname(sqlite3_vfs *v, const char *z, int n, char *o){ (void)v; return gRoot->xFullPathname(gRoot, z, n, o); }
static int slAccess(sqlite3_vfs *v, const char *z, int f, int *r){ (void)v; return gRoot->xAccess(gRoot, z, f, r); }
static int slDelete(sqlite3_vfs *v, const char *z, int s){ (void)v; return gRoot->xDelete(gRoot, z, s); }

#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_slicevfs_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi){
static sqlite3_vfs slVfs; /* static storage: persists for the DLL's lifetime */
SQLITE_EXTENSION_INIT2(pApi);
(void)db; (void)pzErrMsg;
gRoot = sqlite3_vfs_find(0);
if( gRoot==0 ) return SQLITE_ERROR;
if( sqlite3_vfs_find("slicevfs")!=0 ) return SQLITE_OK; /* already registered */
/* Copy the default VFS (correct struct layout by construction), then override only what we
** need. All non-overridden methods stay the default VFS's own implementations. */
memcpy(&slVfs, gRoot, sizeof(slVfs));
slVfs.szOsFile = sizeof(SliceFile);
slVfs.zName = "slicevfs";
slVfs.pNext = 0;
slVfs.xOpen = slOpen;
slVfs.xFullPathname = slFullPathname;
slVfs.xAccess = slAccess;
slVfs.xDelete = slDelete;
return sqlite3_vfs_register(&slVfs, 0);
}
Binary file modified libraries/SQLite/x64/System.Data.SQLite.dll
Binary file not shown.
Loading
Loading