ezKit 1.12.32__py3-none-any.whl → 1.12.34__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 +10 -12
- {ezkit-1.12.32.dist-info → ezkit-1.12.34.dist-info}/METADATA +1 -1
- {ezkit-1.12.32.dist-info → ezkit-1.12.34.dist-info}/RECORD +6 -6
- {ezkit-1.12.32.dist-info → ezkit-1.12.34.dist-info}/WHEEL +0 -0
- {ezkit-1.12.32.dist-info → ezkit-1.12.34.dist-info}/licenses/LICENSE +0 -0
- {ezkit-1.12.32.dist-info → ezkit-1.12.34.dist-info}/top_level.txt +0 -0
ezKit/database.py
CHANGED
@@ -698,8 +698,12 @@ class DatabaseAsyncSession:
|
|
698
698
|
result = await self.operater(statement, params, **kwargs)
|
699
699
|
if result is None:
|
700
700
|
return []
|
701
|
-
|
702
|
-
|
701
|
+
try:
|
702
|
+
rows = result.mappings().all()
|
703
|
+
return [dict(row) for row in rows]
|
704
|
+
except Exception as e:
|
705
|
+
logger.exception(e)
|
706
|
+
return []
|
703
707
|
|
704
708
|
|
705
709
|
# --------------------------------------------------------------------------------------------------
|
@@ -723,7 +727,7 @@ async def async_create_and_count(db: DatabaseAsyncSession, schema: Type[Declarat
|
|
723
727
|
async def async_read_and_count(db: DatabaseAsyncSession, table_name: str, data: dict, statement_prefix: str, statement_end: str = "") -> dict:
|
724
728
|
|
725
729
|
# 初始返回结果 (适用于 count 等于 0)
|
726
|
-
result = {"count": 0, "data":
|
730
|
+
result = {"count": 0, "data": [], "pageIndex": data["pageIndex"], "pageSize": 0}
|
727
731
|
|
728
732
|
# ----------------------------------------------------------------------------------------------
|
729
733
|
|
@@ -754,13 +758,7 @@ async def async_read_and_count(db: DatabaseAsyncSession, table_name: str, data:
|
|
754
758
|
|
755
759
|
# 读取数据
|
756
760
|
|
757
|
-
read_statement = text(
|
758
|
-
f"""
|
759
|
-
{statement_prefix}
|
760
|
-
{where_clause}
|
761
|
-
{statement_end}
|
762
|
-
"""
|
763
|
-
).bindparams(*bind_params)
|
761
|
+
read_statement = text(f"{statement_prefix} {where_clause} {statement_end}").bindparams(*bind_params)
|
764
762
|
|
765
763
|
read_result = await db.operate_return_mappings_all(read_statement, statement_params)
|
766
764
|
|
@@ -803,7 +801,7 @@ async def async_update_and_count(db: DatabaseAsyncSession, table_name: str, data
|
|
803
801
|
return {"code": 1002, "data": None, "message": sqlalchemy_error["statement_params"]["message"]}
|
804
802
|
|
805
803
|
if count_result == 0:
|
806
|
-
return {"code": 1003, "data": 0, "message": database_error["
|
804
|
+
return {"code": 1003, "data": 0, "message": database_error["no_data"]["message"]}
|
807
805
|
|
808
806
|
# ----------------------------------------------------------------------------------------------
|
809
807
|
|
@@ -853,7 +851,7 @@ async def async_delete_and_count(db: DatabaseAsyncSession, table_name: str, data
|
|
853
851
|
return {"code": 1002, "data": None, "message": sqlalchemy_error["statement_params"]["message"]}
|
854
852
|
|
855
853
|
if count_result == 0:
|
856
|
-
return {"code": 1003, "data": 0, "message": database_error["
|
854
|
+
return {"code": 1003, "data": 0, "message": database_error["no_data"]["message"]}
|
857
855
|
|
858
856
|
# ----------------------------------------------------------------------------------------------
|
859
857
|
|
@@ -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=snbC_f9D1F4mRVpIDJb_LaD6dKNTFuj1pe_VrtZ58DA,30143
|
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.34.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
21
|
+
ezkit-1.12.34.dist-info/METADATA,sha256=PHKodiulBCEcmzlafkY7NrFhHmNkzS1YS4sw55rDqK0,317
|
22
|
+
ezkit-1.12.34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ezkit-1.12.34.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
24
|
+
ezkit-1.12.34.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|