Files
dakiny-bot/database_setup/sql_data_classes.py
T
imcompiling ac8d1bc681
build_develop / build (push) Successful in 1m24s
Start update_birthdays function.
2023-08-26 23:04:31 -04:00

18 lines
523 B
Python

"""
Simple file to set up the sqlalchemy connection to database.
"""
from sqlalchemy import create_engine
from sqlalchemy.ext.automap import automap_base
# connect with sql alchemy and autoload schema
URL = "sqlite+pysqlite:///database/dakiny.db"
engine = create_engine(URL)
Base = automap_base()
Base.prepare(autoload_with=engine)
# define the classes
ElectionInformation = Base.classes.ElectionInformation
CouncilMembers = Base.classes.CouncilMembers
Votes = Base.classes.Votes
UserBirthday = Base.classes.UserBirthday