Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Part of epic #40. Depends on #1 (archive_io) and #2 (bundle_locator).
Goal
Serve configs and SQL templates from the in-memory archive when a
bundle is detected. Hook into the existing IFileProvider abstraction
so nothing else in the codebase has to know a bundle exists.
Scope
- New
src/embedded_archive_file_provider.{hpp,cpp}implementing
IFileProvider(interface atsrc/include/vfs_adapter.hpp:27-73):ReadFile,FileExists,ListFiles(with glob),
IsRemotePath(always false forembed://relative paths),
GetProviderName.- Constructor takes a
std::shared_ptr<ArchiveContents>so the
same decompressed map is shared with the DuckDB filesystem (Minor auth configuration issues #4).
- Update
FileProviderFactory::CreateProviderat
src/vfs_adapter.cpp:403-408:- New dispatch order: remote-scheme → embedded (if bundle
present) → local. - The factory needs an injected
ArchiveContentspointer; pass
nullptrfor "no bundle" → behaviour reverts to current logic.
- New dispatch order: remote-scheme → embedded (if bundle
- Wire detection in
src/main.cpp(near theDatabaseManager
init at lines 154-160):- Call
bundle_locator::locate(selfpath())once at startup. - If found, decompress entries (Issues noticed while dockerizing the bq connection to flapi #1) into a shared
ArchiveContents. - Pass to the factory.
- Call
Red tests (test/cpp/embedded_archive_file_provider_test.cpp)
ReadFile("sqls/customers.sql")returns the bytes that were put
into the archive.FileExistsmatches presence/absence correctly.ListFiles("sqls", "*.sql")honours the glob pattern at parity
withLocalFileProvider::ListFiles.- Factory dispatch:
- bundle present, local-looking path → embedded provider
- bundle present,
s3://…→ DuckDB provider (unchanged) - bundle absent, local path →
LocalFileProvider(unchanged)
Green criteria
- All four red tests pass.
- Existing
vfs_adapter_test.cpptests still pass — no regression
in remote/local dispatch. make integration-teststill green (filesystem mode unchanged
when no bundle is present).
Files
- New:
src/embedded_archive_file_provider.{hpp,cpp},
test/cpp/embedded_archive_file_provider_test.cpp - Modified:
src/vfs_adapter.cpp(factory),src/main.cpp(wire-up)
Reuse
IFileProvider(src/include/vfs_adapter.hpp:27-73).PathSchemeUtils::IsRemotePath(src/vfs_adapter.cpp:43-44) —
do NOT alter; embedded provider goes between remote and local.ConfigLoaderandSqlTemplateProcessoralready accept any
IFileProvider— no changes there.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: EmbeddedArchiveFileProvider + factory dispatch + bundle detection
feat: EmbeddedArchiveFileProvider + factory dispatch + bundle detecti…
feat: embed:// DuckDB filesystem for SQL-side bundle reads
feat: embed:// DuckDB filesystem for SQL-side bundle reads (#54)