auth from extension

This commit is contained in:
msramalho
2023-02-24 15:39:11 +01:00
parent 75e98f5f31
commit f6b116554f
14 changed files with 164 additions and 224 deletions

14
src/db/database.py Normal file
View File

@@ -0,0 +1,14 @@
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URL = "sqlite:///./auto-archiver.db"
# SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db"
engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()