Files
pricing/src/data/database_interaction.py
David Doebel b3663258e4 Replace hardcoded DB credentials with environment-driven configuration.
Centralize DB settings in ingestion config, remove embedded secrets from ingestion helpers, and add an idempotent PostgreSQL bootstrap script to create role/database and apply schema safely.

Made-with: Cursor
2026-04-02 16:30:50 +02:00

15 lines
374 B
Python

import pandas as pd
from option_pricing.src.data.ingestion.db_connect import db_engine
def fetch_underlyings() -> pd.DataFrame:
"""
Fetch all entries from the underlyings table using configured DB credentials.
"""
engine = db_engine()
return pd.read_sql("SELECT * FROM underlyings;", engine)
if __name__ == "__main__":
print(fetch_underlyings())