aiteamutils 0.2.127__py3-none-any.whl → 0.2.129__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
|
15
15
|
from sqlalchemy.exc import SQLAlchemyError
|
16
16
|
from datetime import datetime
|
17
17
|
from contextlib import asynccontextmanager
|
@@ -448,16 +448,17 @@ async def list_entities(
|
|
448
448
|
List[Dict[str, Any]]: 쿼리 결과 리스트.
|
449
449
|
"""
|
450
450
|
try:
|
451
|
-
#
|
451
|
+
# 명시적 조인이 있는 경우
|
452
452
|
if explicit_joins:
|
453
453
|
query = select(model, *explicit_joins)
|
454
454
|
for join_target in explicit_joins:
|
455
455
|
query = query.outerjoin(join_target)
|
456
|
+
# 명시적 조인이 없는 경우
|
456
457
|
else:
|
457
458
|
query = select(model)
|
458
|
-
|
459
|
-
|
460
|
-
|
459
|
+
if loading_joins:
|
460
|
+
for join_option in loading_joins:
|
461
|
+
query = query.options(join_option)
|
461
462
|
|
462
463
|
# 필터 조건 적용
|
463
464
|
if filters:
|
@@ -485,7 +486,7 @@ async def list_entities(
|
|
485
486
|
|
486
487
|
result = await session.execute(query)
|
487
488
|
|
488
|
-
return result.
|
489
|
+
return result.scalars().unique().all()
|
489
490
|
except SQLAlchemyError as e:
|
490
491
|
raise CustomException(
|
491
492
|
ErrorCode.DB_READ_ERROR,
|
@@ -502,18 +503,17 @@ async def get_entity(
|
|
502
503
|
loading_joins: Optional[List[Any]] = None
|
503
504
|
) -> ModelType:
|
504
505
|
try:
|
505
|
-
#
|
506
|
-
query = select(model, *[join_target for join_target in (explicit_joins or [])])
|
507
|
-
|
508
|
-
# 명시적 조인 적용
|
506
|
+
# 명시적 조인이 있는 경우
|
509
507
|
if explicit_joins:
|
508
|
+
query = select(model, *explicit_joins)
|
510
509
|
for join_target in explicit_joins:
|
511
|
-
query = query.outerjoin(join_target)
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
510
|
+
query = query.outerjoin(join_target)
|
511
|
+
# 명시적 조인이 없는 경우
|
512
|
+
else:
|
513
|
+
query = select(model)
|
514
|
+
if loading_joins:
|
515
|
+
for join_option in loading_joins:
|
516
|
+
query = query.options(join_option)
|
517
517
|
|
518
518
|
if conditions:
|
519
519
|
for key, value in conditions.items():
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.129"
|
@@ -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=9E5vFC22qeAhU-M4bfzNO53rg43y3CSAsSqrwHmEOHI,20175
|
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=d_-Dlw9uKxvmVtrtYblYVCPX-bJvQt2CYRY9_LVZUJE,43
|
13
|
+
aiteamutils-0.2.129.dist-info/METADATA,sha256=VXFPjrbhCzEIQw3ZGSkV4VrsqTAfoH-02cfYsgCx3sI,1719
|
14
|
+
aiteamutils-0.2.129.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
aiteamutils-0.2.129.dist-info/RECORD,,
|
File without changes
|