(self, sql)
| 319 | return self.add_batch(sql, datas) |
| 320 | |
| 321 | def update(self, sql) -> int: |
| 322 | affect_count = None |
| 323 | conn, cursor = None, None |
| 324 | |
| 325 | try: |
| 326 | conn, cursor = self.get_connection() |
| 327 | affect_count = cursor.execute(sql) |
| 328 | conn.commit() |
| 329 | except Exception as e: |
| 330 | log.error( |
| 331 | """ |
| 332 | error:%s |
| 333 | sql: %s |
| 334 | """ |
| 335 | % (e, sql) |
| 336 | ) |
| 337 | finally: |
| 338 | self.close_connection(conn, cursor) |
| 339 | |
| 340 | return affect_count |
| 341 | |
| 342 | def update_smart(self, table, data: Dict, condition) -> int: |
| 343 | """ |
no test coverage detected