From f2cfc44b02540e4e627de99aed4b448be4f79ff2 Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Tue, 6 Jun 2023 17:29:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=93=8D=E4=BD=9C=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E6=88=90=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prompt_generator.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/prompt_generator.py b/prompt_generator.py index 9f0f9d1..4fa4334 100644 --- a/prompt_generator.py +++ b/prompt_generator.py @@ -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 \ No newline at end of file