Skip to content

Commit ceb4c3b

Browse files
committed
style: rename to bulk_update_from_dicts
1 parent f36bac7 commit ceb4c3b

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ Generate sql and execute
152152
WHERE `id` IN (4,5,6)
153153
```
154154

155-
### **bulk_update**
155+
### **bulk_update_from_dicts**
156156
```python
157-
await AccountMgr.bulk_update(
157+
await AccountMgr.bulk_update_from_dicts(
158158
[
159159
{'id': 7, 'active': False, 'gender': <GenderEnum.male: 1>},
160160
{'id': 15, 'active': True, 'gender': <GenderEnum.unknown: 0>}

examples/service/routers/account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class UpdateIn(BaseModel):
185185
async def bulk_update_view(
186186
dicts: List[UpdateIn] = Body(..., embed=True),
187187
):
188-
row_cnt = await AccountMgr.bulk_update(
188+
row_cnt = await AccountMgr.bulk_update_from_dicts(
189189
[d.dict() for d in dicts],
190190
join_fields=["id"],
191191
update_fields=["active", "gender"],

fastapi_esql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
timing,
1818
)
1919

20-
__version__ = "0.0.4"
20+
__version__ = "0.0.5"
2121

2222
__all__ = [
2323
"QsParsingError",

fastapi_esql/orm/base_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ async def insert_into_select(
140140
return await CursorHandler.exec_if_ok(sql, cls.rw_conn, logger)
141141

142142
@classmethod
143-
async def bulk_update(
143+
async def bulk_update_from_dicts(
144144
cls,
145145
dicts: List[Dict[str, Any]],
146146
join_fields: List[str],
147147
update_fields: List[str],
148148
using_values: bool = True,
149149
):
150-
sql = SQLizer.bulk_update(
150+
sql = SQLizer.bulk_update_from_dicts(
151151
cls.table,
152152
dicts,
153153
join_fields,

fastapi_esql/utils/sqlizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def build_fly_table(
275275
return sql
276276

277277
@classmethod
278-
def bulk_update(
278+
def bulk_update_from_dicts(
279279
cls,
280280
table: str,
281281
dicts: List[Dict[str, Any]],

0 commit comments

Comments
 (0)