aiteamutils 0.2.20__tar.gz → 0.2.21__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/PKG-INFO +1 -1
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/database.py +7 -8
- aiteamutils-0.2.21/aiteamutils/version.py +2 -0
- aiteamutils-0.2.20/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/.gitignore +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/README.md +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/base_service.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/dependencies.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/pyproject.toml +0 -0
- {aiteamutils-0.2.20 → aiteamutils-0.2.21}/setup.py +0 -0
@@ -105,10 +105,10 @@ class DatabaseService:
|
|
105
105
|
@asynccontextmanager
|
106
106
|
async def get_session(self) -> AsyncGenerator[AsyncSession, None]:
|
107
107
|
"""데이터베이스 세션을 생성하고 반환하는 비동기 컨텍스트 매니저."""
|
108
|
-
if self.
|
108
|
+
if self.session_factory is None:
|
109
109
|
raise RuntimeError("Session factory not initialized")
|
110
110
|
|
111
|
-
async with self.
|
111
|
+
async with self.session_factory() as session:
|
112
112
|
try:
|
113
113
|
yield session
|
114
114
|
finally:
|
@@ -792,13 +792,12 @@ class DatabaseService:
|
|
792
792
|
CustomException: 데이터베이스 작업 중 오류 발생 시
|
793
793
|
"""
|
794
794
|
try:
|
795
|
-
if self.db:
|
796
|
-
|
795
|
+
if self.db is not None:
|
796
|
+
return await self.db.execute(query)
|
797
|
+
|
798
|
+
async with self.get_session() as session:
|
799
|
+
result = await session.execute(query)
|
797
800
|
return result
|
798
|
-
else:
|
799
|
-
async with self.session_factory() as session:
|
800
|
-
result = await session.execute(query)
|
801
|
-
return result
|
802
801
|
except Exception as e:
|
803
802
|
raise CustomException(
|
804
803
|
ErrorCode.DB_QUERY_ERROR,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|