MCPcopy Create free account
hub / github.com/Boris-code/feapder / add_batch_smart

Method add_batch_smart

feapder/db/mysqldb.py:307–319  ·  view source on GitHub ↗

批量添加数据, 直接传递list格式的数据,不用拼sql Args: table: 表名 datas: 列表 [{}, {}, {}] **kwargs: Returns: 添加行数

(self, table, datas: List[Dict], **kwargs)

Source from the content-addressed store, hash-verified

305 return affect_count
306
307 def add_batch_smart(self, table, datas: List[Dict], **kwargs) -> int:
308 """
309 批量添加数据, 直接传递list格式的数据,不用拼sql
310 Args:
311 table: 表名
312 datas: 列表 [{}, {}, {}]
313 **kwargs:
314
315 Returns: 添加行数
316
317 """
318 sql, datas = make_batch_sql(table, datas, **kwargs)
319 return self.add_batch(sql, datas)
320
321 def update(self, sql) -> int:
322 affect_count = None

Callers

nothing calls this directly

Calls 2

add_batchMethod · 0.95
make_batch_sqlFunction · 0.90

Tested by

no test coverage detected