Initial commit: AuroraMusic monorepo
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from aurora_db.base import Base
|
||||
from aurora_db.session import make_engine, make_sessionmaker
|
||||
|
||||
from .config import settings
|
||||
|
||||
engine = make_engine(settings.database_url)
|
||||
SessionLocal = make_sessionmaker(engine)
|
||||
|
||||
__all__ = ["Base", "engine", "SessionLocal", "get_db"]
|
||||
|
||||
|
||||
def get_db():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user