From eec20952a9553e74872b982e45f4506eccdaf30c Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sun, 27 Mar 2022 18:29:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=20exec()=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=AF=E4=BB=A5=E5=8D=95=E7=8B=AC=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/db.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/db/db.py b/app/db/db.py index b0d7f05..8795f5a 100644 --- a/app/db/db.py +++ b/app/db/db.py @@ -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