Skip to content

Add PostgreSQL-backed data store for production deployments#238

Merged
michaelchu merged 2 commits intomainfrom
feature/postgres-data-store
Feb 28, 2026
Merged

Add PostgreSQL-backed data store for production deployments#238
michaelchu merged 2 commits intomainfrom
feature/postgres-data-store

Conversation

@michaelchu
Copy link
Copy Markdown
Member

Summary

  • Adds DataStore abstraction and PostgresStore implementation that stores options/stock data in proper PostgreSQL tables (options_data, stocks_data) instead of parquet files on disk
  • Auto-selects backend via get_store(): PostgreSQL when DATABASE_URL is set, parquet files otherwise
  • Adds optopsy-data import CLI command to import local parquet files into PostgreSQL
  • All existing call sites updated from ParquetCache() to get_store()

Test plan

  • All 1863 existing tests pass
  • Linting and formatting pass
  • Local dev without DATABASE_URL still uses parquet cache
  • With DATABASE_URL set, data is stored/read from PostgreSQL
  • optopsy-data import ~/.optopsy/cache/options/SPY.parquet imports into Postgres
  • optopsy-data cache size reports row counts from Postgres

🤖 Generated with Claude Code

@michaelchu michaelchu merged commit 4321082 into main Feb 28, 2026
8 checks passed
@michaelchu michaelchu deleted the feature/postgres-data-store branch February 28, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant