aiteamutils 0.2.126__py3-none-any.whl → 0.2.128__py3-none-any.whl
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.
aiteamutils/database.py
CHANGED
@@ -11,7 +11,7 @@ from typing import (
|
|
11
11
|
)
|
12
12
|
from sqlalchemy.ext.asyncio import AsyncSession
|
13
13
|
from sqlalchemy import select, and_, or_
|
14
|
-
from sqlalchemy.orm import DeclarativeBase, joinedload, selectinload
|
14
|
+
from sqlalchemy.orm import DeclarativeBase, joinedload, selectinload, noload
|
15
15
|
from sqlalchemy.exc import SQLAlchemyError
|
16
16
|
from datetime import datetime
|
17
17
|
from contextlib import asynccontextmanager
|
@@ -448,17 +448,16 @@ async def list_entities(
|
|
448
448
|
List[Dict[str, Any]]: 쿼리 결과 리스트.
|
449
449
|
"""
|
450
450
|
try:
|
451
|
-
|
452
|
-
|
453
|
-
# 명시적 조인 적용
|
451
|
+
# 메인 모델과 조인된 모델의 모든 컬럼을 명시적으로 선택
|
454
452
|
if explicit_joins:
|
453
|
+
query = select(model, *explicit_joins).select_from(model)
|
455
454
|
for join_target in explicit_joins:
|
456
|
-
query = query.outerjoin(join_target)
|
455
|
+
query = query.outerjoin(join_target)
|
456
|
+
else:
|
457
|
+
query = select(model)
|
457
458
|
|
458
|
-
#
|
459
|
-
|
460
|
-
for join_option in loading_joins:
|
461
|
-
query = query.options(join_option)
|
459
|
+
# 불필요한 lazy loading 방지를 위해 noload 옵션 추가
|
460
|
+
query = query.options(noload('*'))
|
462
461
|
|
463
462
|
# 필터 조건 적용
|
464
463
|
if filters:
|
@@ -486,7 +485,7 @@ async def list_entities(
|
|
486
485
|
|
487
486
|
result = await session.execute(query)
|
488
487
|
|
489
|
-
return result.
|
488
|
+
return result.unique().scalars().all()
|
490
489
|
except SQLAlchemyError as e:
|
491
490
|
raise CustomException(
|
492
491
|
ErrorCode.DB_READ_ERROR,
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.128"
|
@@ -4,12 +4,12 @@ aiteamutils/base_repository.py,sha256=vzBw3g3jCJetTDblZvZenEGXk89Qu_65_02C7QTcf8
|
|
4
4
|
aiteamutils/base_service.py,sha256=nHikjwGp29QrQPr2W8Ye9sKxmVS_8prRG3Nu42TU1Ms,10670
|
5
5
|
aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
|
6
6
|
aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
7
|
-
aiteamutils/database.py,sha256=
|
7
|
+
aiteamutils/database.py,sha256=rs0PcH1sXvDxrDVrt2obOVG3pjkxITci7gI0O4LBgMI,20224
|
8
8
|
aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
|
9
9
|
aiteamutils/exceptions.py,sha256=pgf3ersezObyl17wAO3I2fb8m9t2OzWDX1mSjwAWm2Y,16035
|
10
10
|
aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
|
11
11
|
aiteamutils/validators.py,sha256=msOrha36xWsapm4VAh63YmFq1GVyC9tzZcjXYFCEZ_g,11949
|
12
|
-
aiteamutils/version.py,sha256=
|
13
|
-
aiteamutils-0.2.
|
14
|
-
aiteamutils-0.2.
|
15
|
-
aiteamutils-0.2.
|
12
|
+
aiteamutils/version.py,sha256=MP8cUhHdHhWOdkGTtsxbeIs15ZLja70gxlZbWTXsnfA,43
|
13
|
+
aiteamutils-0.2.128.dist-info/METADATA,sha256=NWIu-gt09mx7QmhNnBLVdSCy68UgHI1hDzUT-X0HtIk,1719
|
14
|
+
aiteamutils-0.2.128.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
aiteamutils-0.2.128.dist-info/RECORD,,
|
File without changes
|