Migrate data pipeline from SQLite to PostgreSQL + Docker setup
- Add db.py PostgreSQL abstraction layer (connection, upsert, table mgmt) - Replace sqlite3 with psycopg2 in: live_candle_fetcher, resampler, data_fetcher, fetch_history, import_csv, indicators, base_strategy - Sanitize table names (colons -> underscores) for PostgreSQL compat - Replace INSERT OR REPLACE with ON CONFLICT upserts - Replace pandas to_sql() with batch upsert_candles() - Add scripts: resampler_loop, gap_detector, backup_runner, cron_scheduler - Add migrate_sqlite_to_pg.py for one-time data migration - Add Dockerfile, docker-compose.yml, supervisord.conf - Add postgres/postgresql.conf tuned for 4GB RAM (Synology DS1513+) - Add .dockerignore, .env.docker.example, secrets template - Update requirements.txt (psycopg2-binary), .gitignore - Add MIGRATION_PLAN.md with full plan and todo list
This commit is contained in:
7
.env.docker.example
Normal file
7
.env.docker.example
Normal file
@ -0,0 +1,7 @@
|
||||
# Docker environment variables
|
||||
# Copy to .env.docker and fill in real values.
|
||||
# DO NOT commit the real .env.docker file to git.
|
||||
|
||||
POSTGRES_PASSWORD=change_me
|
||||
PG_CONN_STR=postgresql://hyper:change_me@postgres:5432/hyper
|
||||
COINGECKO_API_KEY=
|
||||
Reference in New Issue
Block a user