import constants
from db import MySQLConnection

# main_db.py - Program entry point for Part 1 Database

if __name__ == "__main__":
    db = MySQLConnection(
        host=constants.DB_HOST,
        user=constants.DB_USER,
        password=constants.DB_PASS
    )
    with db.cursor() as cursor:
        # Recreate database and select as default
        cursor.execute(f"DROP DATABASE IF EXISTS {constants.DB_NAME};")
        cursor.execute(f"CREATE DATABASE {constants.DB_NAME};")
        cursor.execute(f"USE {constants.DB_NAME};")

        # Tables
        # TODO: Create tables according to the database description

        # Records
        # TODO: Insert records according to the database description

    db.commit()
    db.close()
