添加了 exec() 方法可以单独进行数据库的其他命令操作

This commit is contained in:
MarkusJoe
2022-03-27 18:29:23 +08:00
parent 80a5f4425c
commit eec20952a9
1 file changed
+6 -1
+6 -1
View File
@@ -7,7 +7,7 @@
import sqlite3 import sqlite3
from typing import List from typing import List, Any
class SQLite: class SQLite:
@@ -136,3 +136,8 @@ class SQLite:
return lst return lst
else: else:
return [] return []
def exec(self, cmd: str) -> List[Any]:
self.__cursor.execute(cmd)
result = self.__cursor.fetchall()
return result