(db_obj, table)
| 105 | |
| 106 | # 检查表是否存在 |
| 107 | def check_exists_table(db_obj, table): |
| 108 | res = db_obj.query("SELECT * FROM sqlite_master WHERE type='table' AND name='{}';".format(table)) |
| 109 | if 'unable to open database file' in res: |
| 110 | return True |
| 111 | |
| 112 | if not isinstance(res, list): |
| 113 | |
| 114 | print_x('{} 读取失败,可能原因表已损坏'.format(table)) |
| 115 | return False |
| 116 | if len(res) > 0: |
| 117 | return True |
| 118 | return False |
| 119 | |
| 120 | |
| 121 | # 同步单个表 |