feat: add job & artifact tables

* remove `accounts` table in favor of a simple API key auth
This commit is contained in:
Felix Spöttel
2023-01-05 10:14:50 +01:00
parent 4f7cd063f1
commit b3a38846ba
15 changed files with 153 additions and 139 deletions

View File

@@ -10,9 +10,12 @@ engine = create_engine(settings.DATABASE_URI)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
def get_db() -> Generator[Session, None, None]:
db = SessionLocal()
def get_session() -> Generator[Session, None, None]:
db: Session = SessionLocal()
try:
yield db
db.commit()
except Exception:
db.rollback()
finally:
db.close()