Archived
添加了 exec() 方法可以单独进行数据库的其他命令操作
This commit is contained in:
1 file changed
+6
-1
+6
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
import sqlite3
|
||||
from typing import List
|
||||
from typing import List, Any
|
||||
|
||||
|
||||
class SQLite:
|
||||
@@ -136,3 +136,8 @@ class SQLite:
|
||||
return lst
|
||||
else:
|
||||
return []
|
||||
|
||||
def exec(self, cmd: str) -> List[Any]:
|
||||
self.__cursor.execute(cmd)
|
||||
result = self.__cursor.fetchall()
|
||||
return result
|
||||
Reference in New Issue
Block a user