diff options
author | Parker <contact@pkrm.dev> | 2024-06-24 16:24:09 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-06-24 16:24:09 -0500 |
commit | 5b92454760a8af14bd1031e72024946f868d1de6 (patch) | |
tree | f8384cbf0d142777d9bff341e13fd5882182908b /database.py | |
parent | 80a39d38bf829193c655a7320c86df2a3146db2a (diff) |
Major overhaul + Bare bones web UI
Diffstat (limited to 'database.py')
-rw-r--r-- | database.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/database.py b/database.py new file mode 100644 index 0000000..544ee05 --- /dev/null +++ b/database.py @@ -0,0 +1,13 @@ +from sqlalchemy import create_engine +from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.orm import sessionmaker +import os + +# Create 'data' directory at root if it doesn't exist +if not os.path.exists("data"): + os.makedirs("data") + +engine = create_engine("sqlite:///data/data.db") +SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) + +Base = declarative_base() |