Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Part of epic #40. Depends on #3 (ArchiveContents shared state).
Goal
Let SQL templates reference bundled files directly:
read_csv('embed://data/cities.csv'). This bypasses IFileProvider
and goes through DuckDB's VirtualFileSystem, so we need a custom
duckdb::FileSystem subclass registered with the DuckDB instance
flapi already owns.
Scope
- New
src/duckdb_embed_fs.{hpp,cpp}subclassingduckdb::FileSystem. - Constructor takes the same
std::shared_ptr<ArchiveContents>as
the embedded file provider (Ability to pass default values to query parameters #3) — one decompressed map, two readers. - Override:
OpenFile— return a customFileHandleover an in-memory blob.Read(both overloads),Seek,GetFileSize.Glob—read_csv()expands paths before opening; base
throws "not implemented" (spike caught this at runtime).SeekPosition— same reason.
CanHandleFilechecks forembed://scheme prefix.- Register on the DuckDB instance once at startup
(src/main.cpp, after the database manager exists) — only when a
bundle is present.
Red tests (test/cpp/duckdb_embed_fs_test.cpp)
- Proof-of-life (spike behaviour Feature Request: Support Apache Arrow IPC Streaming over HTTP #9):
- In-process DuckDB instance.
- Register
EmbeddedFileSystemover a fixture archive containing
data/cities.csv. - Execute
SELECT * FROM read_csv('embed://data/cities.csv'). - Assert the expected rows come back.
Glob('embed://data/*.csv')returns the expected entries
(catchesread_csvglob expansion).- Mixed read: a template that joins
embed://against a regular
parquet path on disk works (no interference with default
filesystem).
Green criteria
- All red tests pass.
- DuckDB tests in the existing suite still pass.
make integration-teststill green.
Files
- New:
src/duckdb_embed_fs.{hpp,cpp},test/cpp/duckdb_embed_fs_test.cpp - Modified:
src/main.cpp(register on DB instance when bundle exists)
Notes
DuckDBVFSProvideralready touches DuckDB's internal FileSystem
API (src/vfs_adapter.cpp:218-397) and has TODOs about that being
unstable. The embed FS uses the same surface — we accept the same
trade-off, and the round-trip integration test (Flapi exe is not working for non docker local testing #6) catches drift
on every CI run.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: embed:// DuckDB filesystem for SQL-side bundle reads
feat: embed:// DuckDB filesystem for SQL-side bundle reads (#54)
feat: flapi pack / info / unpack subcommands
feat: flapi pack / info / unpack subcommands (#55)
test: end-to-end integration tests for self-packaging round-trip
test: end-to-end integration tests for self-packaging round-trip (#56)