From ca1bb8ea59240a8f59d951678fbdfbe36efe0190 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Sat, 27 Apr 2024 18:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E5=B9=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=9A=84=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/merge_db.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pywxdump/wx_info/merge_db.py b/pywxdump/wx_info/merge_db.py index f4d1448..777f35f 100644 --- a/pywxdump/wx_info/merge_db.py +++ b/pywxdump/wx_info/merge_db.py @@ -5,6 +5,7 @@ # Author: xaoyaoo # Date: 2023/12/03 # ------------------------------------------------------------------------------- +import logging import os import random import shutil @@ -282,7 +283,11 @@ def merge_db(db_paths, save_path="merge.db", CreateTime: int = 0, endCreateTime: continue # 插入数据 sql = f"INSERT OR IGNORE INTO {table} ({','.join([i[0] for i in col_type])}) VALUES ({','.join(['?'] * len(columns))})" - out_cursor.executemany(sql, src_data) + try: + out_cursor.executemany(sql, src_data) + except Exception as e: + logging.error(f"error: {alias}\n{table}\n{sql}\n{src_data}\n{len(src_data)}\n{e}\n**********") + raise e outdb.commit() db.close() outdb.close()