GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
21 lines
449 B
Python
21 lines
449 B
Python
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker, Session
|
|
|
|
from app.core.config import get_settings
|
|
|
|
|
|
engine = create_engine(get_settings().database_url, pool_pre_ping=True, future=True)
|
|
SessionLocal = sessionmaker(bind=engine, autocommit=False, autoflush=False, future=True)
|
|
|
|
|
|
def get_db():
|
|
db: Session = SessionLocal()
|
|
try:
|
|
yield db
|
|
finally:
|
|
db.close()
|
|
|
|
|
|
def get_engine():
|
|
return engine
|