ezKit 1.12.34__py3-none-any.whl → 1.12.36__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.
- ezKit/database.py +8 -4
- {ezkit-1.12.34.dist-info → ezkit-1.12.36.dist-info}/METADATA +1 -1
- {ezkit-1.12.34.dist-info → ezkit-1.12.36.dist-info}/RECORD +6 -6
- {ezkit-1.12.34.dist-info → ezkit-1.12.36.dist-info}/WHEEL +0 -0
- {ezkit-1.12.34.dist-info → ezkit-1.12.36.dist-info}/licenses/LICENSE +0 -0
- {ezkit-1.12.34.dist-info → ezkit-1.12.36.dist-info}/top_level.txt +0 -0
ezKit/database.py
CHANGED
@@ -346,7 +346,7 @@ class Database:
|
|
346
346
|
return True
|
347
347
|
except Exception as e:
|
348
348
|
logger.error(f"{info} [failed]")
|
349
|
-
logger.
|
349
|
+
logger.exception(e)
|
350
350
|
return False
|
351
351
|
|
352
352
|
# ----------------------------------------------------------------------------------------------
|
@@ -683,7 +683,7 @@ class DatabaseAsyncSession:
|
|
683
683
|
return result
|
684
684
|
except Exception as e:
|
685
685
|
await session.rollback()
|
686
|
-
logger.
|
686
|
+
logger.error(e)
|
687
687
|
return None
|
688
688
|
|
689
689
|
# 精确返回一个标量结果 (适用于只返回一行数据的select, 比如 count 查询)
|
@@ -691,7 +691,11 @@ class DatabaseAsyncSession:
|
|
691
691
|
result = await self.operater(statement, params, **kwargs)
|
692
692
|
if result is None:
|
693
693
|
return None
|
694
|
-
|
694
|
+
try:
|
695
|
+
return result.scalar_one()
|
696
|
+
except Exception as e:
|
697
|
+
logger.error(e)
|
698
|
+
return None
|
695
699
|
|
696
700
|
# 返回所有结果 (适用于所有select)
|
697
701
|
async def operate_return_mappings_all(self, statement, params: Any | None = None, **kwargs) -> List[Any]:
|
@@ -702,7 +706,7 @@ class DatabaseAsyncSession:
|
|
702
706
|
rows = result.mappings().all()
|
703
707
|
return [dict(row) for row in rows]
|
704
708
|
except Exception as e:
|
705
|
-
logger.
|
709
|
+
logger.error(e)
|
706
710
|
return []
|
707
711
|
|
708
712
|
|
@@ -3,7 +3,7 @@ ezKit/_file.py,sha256=0qRZhwYuagTgTGrhm-tzAMvEQT4HTJA_xZKqF2bo0ho,1207
|
|
3
3
|
ezKit/bottle.py,sha256=43h4v1kzz6qrLvCt5IMN0H-gFtaT0koG9wETqteXsps,181666
|
4
4
|
ezKit/bottle_extensions.py,sha256=27rogmfK7mL2qUSjXH79IMGZbCVULtYEikql_N9O6Zs,1165
|
5
5
|
ezKit/cipher.py,sha256=7jBarRH7ukSYzkz-Anl8B8JzluhnRz4CLHidPRRj_cg,2939
|
6
|
-
ezKit/database.py,sha256=
|
6
|
+
ezKit/database.py,sha256=WhHh-4L8uhqvDr7oIOPUk0jXLfLv0AVPAAKrOzhhxzQ,30239
|
7
7
|
ezKit/dockerhub.py,sha256=j-wQO-71BsOgExHZhYynuy2k_hCX3on-vg0TH7QCit4,1996
|
8
8
|
ezKit/errors.py,sha256=htTi7vKClHGHf2MX2G88PKr0zzUrFiUHEsrmfqj1Fx8,1425
|
9
9
|
ezKit/fastapix.py,sha256=59wqVLqJxNVesZTAwAqkzkiMQHKQQbVUijFP-IDu4ws,2935
|
@@ -17,8 +17,8 @@ ezKit/token.py,sha256=Ac-i9xfq4TqpGyfCzakjrh4NYzxHiN2sCQrMk1tzVi8,1716
|
|
17
17
|
ezKit/utils.py,sha256=U457ahFkxIXuB-qWvS3995xJs-LlkFIX5_ZWVgmL5cY,43130
|
18
18
|
ezKit/xftp.py,sha256=-XQXyhMqeigT63P6sXkSS7r4GROXyqqlkzKxITLWG-g,8278
|
19
19
|
ezKit/zabbix.py,sha256=PkMnfu7mcuotwwIIsHaC9FsNg-gap6hD1xvm0AwSL1Y,33777
|
20
|
-
ezkit-1.12.
|
21
|
-
ezkit-1.12.
|
22
|
-
ezkit-1.12.
|
23
|
-
ezkit-1.12.
|
24
|
-
ezkit-1.12.
|
20
|
+
ezkit-1.12.36.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
21
|
+
ezkit-1.12.36.dist-info/METADATA,sha256=1DO3nvWxn-XTfOoNHEVIeSiNbdnnDX8CZAqVJN8xHcg,317
|
22
|
+
ezkit-1.12.36.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ezkit-1.12.36.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
24
|
+
ezkit-1.12.36.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|