Rename a directory, need to store the db file in a directory.

This commit is contained in:
2023-08-26 21:36:18 -04:00
parent 2991f81e04
commit f6e827fba5
7 changed files with 8 additions and 8 deletions
+16
View File
@@ -0,0 +1,16 @@
"""
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