Add DuckDB as configurable storage backend for work events#10
Open
prithvianilk wants to merge 1 commit intomainfrom
Open
Add DuckDB as configurable storage backend for work events#10prithvianilk wants to merge 1 commit intomainfrom
prithvianilk wants to merge 1 commit intomainfrom
Conversation
Introduces an abstract factory pattern (StorageFactory) to support both
Pinot and DuckDB backends. Backend selection is controlled via the
STORAGE_BACKEND environment variable ('pinot' or 'duckdb').
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
prithvianilk
commented
Jan 13, 2026
|
|
||
| def initialize(self) -> None: | ||
| conn = duckdb.connect(self.db_path) | ||
| conn.execute( |
Owner
Author
There was a problem hiding this comment.
TODO:
Move this outside of code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StorageFactory) to centralize backend selectionSTORAGE_BACKENDenvironment variable (pinotorduckdb)pinotfor backward compatibilityChanges
web-app/storage_factory.py- Abstract factory withPinotStorageFactoryandDuckDBStorageFactoryweb-app/work_repo.py- AddedDuckDBWorkRepoclass with all 8 query methodsweb-app/services/work_ingestion_service.py- AddedDuckDBWorkIngestionServiceclassweb-app/api.py- Now usesStorageFactorypatternmcp-server/main.py- Now usesStorageFactorypatternpyproject.toml- Addedduckdb>=0.9.0dependencyTest plan
STORAGE_BACKEND=duckdbinweb-app/config.envpip install -e .to install duckdb dependencycd web-app && python api.py/api/workwith sample work event/api/v1/main-page-data?since_time=0to verify queries workduckdb kelsa_work.duckdb -c "SELECT * FROM work LIMIT 5"STORAGE_BACKEND=pinotand verify Pinot backend still works🤖 Generated with Claude Code