mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 01:06:19 +00:00
Add new models and database manager
This commit is contained in:
15
src/models/DatabaseManager.py
Normal file
15
src/models/DatabaseManager.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
|
||||
from . import Base
|
||||
|
||||
engine = create_engine(f"sqlite:///local/database/db.db")
|
||||
|
||||
SessionLocal = sessionmaker(bind=engine)
|
||||
|
||||
|
||||
def init_db():
|
||||
Base.metadata.create_all(engine)
|
||||
pass
|
||||
Reference in New Issue
Block a user