特殊操作封装成方法
This commit is contained in:
@ -70,10 +70,18 @@ class SqliteHandle:
|
||||
self.__cursor.execute(f"DELETE from `{self.__table}` where id BETWEEN 1 AND 21")
|
||||
self.__connect.commit()
|
||||
|
||||
sqlite_handle = SqliteHandle
|
||||
if __name__ == '__main__':
|
||||
def delete_tabls(self, tab):
|
||||
self.__cursor.execute(f"DROP TABLE `{tab}`;")
|
||||
self.__connect.commit()
|
||||
|
||||
def cp_db_data():
|
||||
sql_ll = sqlite_handle(database='ai_prompt_cp.db')
|
||||
tabs = sql_ll.get_tables()
|
||||
for i in tabs:
|
||||
old_data = sqlite_handle(table=i, database='ai_prompt_cp.db').get_prompt_value()
|
||||
sqlite_handle(table=i).inset_prompt(old_data)
|
||||
|
||||
|
||||
sqlite_handle = SqliteHandle
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
Reference in New Issue
Block a user