aiteamutils 0.2.20__tar.gz → 0.2.21__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.20
3
+ Version: 0.2.21
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -105,10 +105,10 @@ class DatabaseService:
105
105
  @asynccontextmanager
106
106
  async def get_session(self) -> AsyncGenerator[AsyncSession, None]:
107
107
  """데이터베이스 세션을 생성하고 반환하는 비동기 컨텍스트 매니저."""
108
- if self.async_session is None:
108
+ if self.session_factory is None:
109
109
  raise RuntimeError("Session factory not initialized")
110
110
 
111
- async with self.async_session() as session:
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
- result = await self.db.execute(query)
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,
@@ -0,0 +1,2 @@
1
+ """버전 정보"""
2
+ __version__ = "0.2.21"
@@ -1,2 +0,0 @@
1
- """버전 정보"""
2
- __version__ = "0.2.20"
File without changes
File without changes
File without changes