src/dbconnector.py
def save_to_database(df: pd.DataFrame, file_title: str) -> None:
    """
    This function saves a dataframe to the database

    Args:
        df (str): the table to be stored in the database
        file_title (str): title of the output file

    Returns:
        None   
    """
    db_host = f"postgresql://{user}:{password}@{host}:{port}/{database}"
    db = connect_engine()
    engine = create_engine(db_host, echo= False)
    df.to_sql(f'{file_title}', engine, if_exists= "replace", index= False)
    db.commit()
    return

    This function saves a dataframe to the database

    Args:
        df (str): the table to be stored in the database
        file_title (str): title of the output file

    Returns:
        None   
    
This function saves a dataframe to the database
This function saves a dataframe to the database
def save_to_database(df: pd.DataFrame, file_title: str) -> None:
    db_host = f"postgresql://{user}:{password}@{host}:{port}/{database}"
    db = connect_engine()
    engine = create_engine(db_host, echo= False)
    df.to_sql(f'{file_title}', engine, if_exists= "replace", index= False)
    db.commit()
    return
def save_to_database ( df : pd . DataFrame , file_title : str ) -> None : db_host = f"postgresql://{user}:{password}@{host}:{port}/{database}" db = connect_engine ( ) engine = create_engine ( db_host , echo = False ) df . to_sql ( f'{file_title}' , engine , if_exists = "replace" , index = False ) db . commit ( ) return
This function saves a dataframe to the database
This function saves a dataframe to the database
"""
    This function saves a dataframe to the database

    Args:
        df (str): the table to be stored in the database
        file_title (str): title of the output file

    Returns:
        None   
    """
None
df
pd.DataFrame
the table to be stored in the database
the table to be stored in the database
file_title
str
title of the output file
title of the output file