ezKit 1.12.44__py3-none-any.whl → 1.12.46__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 +12 -2
- {ezkit-1.12.44.dist-info → ezkit-1.12.46.dist-info}/METADATA +1 -1
- {ezkit-1.12.44.dist-info → ezkit-1.12.46.dist-info}/RECORD +6 -6
- {ezkit-1.12.44.dist-info → ezkit-1.12.46.dist-info}/WHEEL +0 -0
- {ezkit-1.12.44.dist-info → ezkit-1.12.46.dist-info}/licenses/LICENSE +0 -0
- {ezkit-1.12.44.dist-info → ezkit-1.12.46.dist-info}/top_level.txt +0 -0
ezKit/database.py
CHANGED
@@ -229,6 +229,10 @@ def build_sqlalchemy_where_clause(data: dict) -> Optional[Tuple[str, Dict[str, A
|
|
229
229
|
# 避免字段名冲突
|
230
230
|
param_key = f"{base.replace('.', '_')}_{op}"
|
231
231
|
|
232
|
+
# 特殊处理日期字段
|
233
|
+
if param_key.startswith("datetime::date"):
|
234
|
+
param_key = param_key.replace("datetime::date", "datetime_date", 1)
|
235
|
+
|
232
236
|
if op == "like":
|
233
237
|
sql_parts.append(f"{base} LIKE :{param_key}")
|
234
238
|
param_dict[param_key] = f"%{value}%"
|
@@ -246,6 +250,9 @@ def build_sqlalchemy_where_clause(data: dict) -> Optional[Tuple[str, Dict[str, A
|
|
246
250
|
param_dict[f"{param_key}_end"] = value[1]
|
247
251
|
else:
|
248
252
|
param_key = base_field.replace(".", "_")
|
253
|
+
# 特殊处理日期字段
|
254
|
+
if param_key.startswith("datetime::date"):
|
255
|
+
param_key = param_key.replace("datetime::date", "datetime_date", 1)
|
249
256
|
sql_parts.append(f"{base_field} = :{param_key}")
|
250
257
|
param_dict[param_key] = value
|
251
258
|
|
@@ -790,11 +797,14 @@ async def async_create_and_count(db: DatabaseAsyncSession, schema: Type[Declarat
|
|
790
797
|
# --------------------------------------------------------------------------------------------------
|
791
798
|
|
792
799
|
|
793
|
-
async def async_read_and_count(db: DatabaseAsyncSession, data: dict,
|
800
|
+
async def async_read_and_count(db: DatabaseAsyncSession, data: dict, statement_select: str, statement_from: str, statement_end: str = "") -> dict:
|
794
801
|
|
795
802
|
# 初始返回结果 (适用于 count 等于 0)
|
796
803
|
result = {"count": 0, "list": [], "pageIndex": data["pageIndex"], "pageSize": 0}
|
797
804
|
|
805
|
+
# Statement Prefix
|
806
|
+
statement_prefix = f"{statement_select} {statement_from}"
|
807
|
+
|
798
808
|
# ----------------------------------------------------------------------------------------------
|
799
809
|
|
800
810
|
# 构建 WHERE
|
@@ -812,7 +822,7 @@ async def async_read_and_count(db: DatabaseAsyncSession, data: dict, statement_p
|
|
812
822
|
|
813
823
|
# table_name: str
|
814
824
|
# count_statement = text(f"SELECT COUNT(*) FROM {table_name} {where_clause}").bindparams(*bind_params)
|
815
|
-
count_statement = text(f"SELECT COUNT(*)
|
825
|
+
count_statement = text(f"SELECT COUNT(*) {statement_from} {where_clause}").bindparams(*bind_params)
|
816
826
|
|
817
827
|
count_result = await db.operate_return_scalar_one(count_statement, statement_params)
|
818
828
|
|
@@ -4,7 +4,7 @@ ezKit/auth.py,sha256=HO19O4qOz68e0YwOP04habxMCAk42B3D7LW7yKgm9ZA,398
|
|
4
4
|
ezKit/bottle.py,sha256=43h4v1kzz6qrLvCt5IMN0H-gFtaT0koG9wETqteXsps,181666
|
5
5
|
ezKit/bottle_extensions.py,sha256=27rogmfK7mL2qUSjXH79IMGZbCVULtYEikql_N9O6Zs,1165
|
6
6
|
ezKit/cipher.py,sha256=7jBarRH7ukSYzkz-Anl8B8JzluhnRz4CLHidPRRj_cg,2939
|
7
|
-
ezKit/database.py,sha256=
|
7
|
+
ezKit/database.py,sha256=g-tiw6pCUx8WQ6gKI3Oofz_JrJ3qIihUpu0HJkm7sRU,33145
|
8
8
|
ezKit/dockerhub.py,sha256=j-wQO-71BsOgExHZhYynuy2k_hCX3on-vg0TH7QCit4,1996
|
9
9
|
ezKit/errors.py,sha256=92PggwPQfTS3Vg4og7GHYnO9CTSM7zmuh2w3kx_tSBE,1425
|
10
10
|
ezKit/fastapix.py,sha256=-nz565ASKvp3nGs9J4wORTHxlhMozqCwv8zREWpmYtI,3382
|
@@ -18,8 +18,8 @@ ezKit/token.py,sha256=Ac-i9xfq4TqpGyfCzakjrh4NYzxHiN2sCQrMk1tzVi8,1716
|
|
18
18
|
ezKit/utils.py,sha256=U457ahFkxIXuB-qWvS3995xJs-LlkFIX5_ZWVgmL5cY,43130
|
19
19
|
ezKit/xftp.py,sha256=-XQXyhMqeigT63P6sXkSS7r4GROXyqqlkzKxITLWG-g,8278
|
20
20
|
ezKit/zabbix.py,sha256=PkMnfu7mcuotwwIIsHaC9FsNg-gap6hD1xvm0AwSL1Y,33777
|
21
|
-
ezkit-1.12.
|
22
|
-
ezkit-1.12.
|
23
|
-
ezkit-1.12.
|
24
|
-
ezkit-1.12.
|
25
|
-
ezkit-1.12.
|
21
|
+
ezkit-1.12.46.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
22
|
+
ezkit-1.12.46.dist-info/METADATA,sha256=J2uHv42pOZww34tMWdg7ABUiKWinOmxH3jymKWK13Tc,317
|
23
|
+
ezkit-1.12.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
24
|
+
ezkit-1.12.46.dist-info/top_level.txt,sha256=aYLB_1WODsqNTsTFWcKP-BN0KCTKcV-HZJ4zlHkCFw8,6
|
25
|
+
ezkit-1.12.46.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|