<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upsert_all(engine, table, data):
 """ Update data by primary key columns. If not able to update, do insert. Example:: # suppose in database we already have {"id": 1, "name": "Alice"} [{"id": 1, "name": "Bob"}, {"id": 2, "name": "Cathy"}] **中文文档** 批量更新文档. 如果该表格定义了Primary Key, 则用Primary Key约束where语句. 对于 where语句无法找到的行, 自动进行批量bulk insert. """

    update_all(engine, table, data, upsert=True)