From a05d9ccfd06059aef9ebd2608f16fc0953cf5ab1 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 29 Mar 2023 15:30:14 +0200 Subject: count intimacy, untested --- catdb.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'catdb.py') diff --git a/catdb.py b/catdb.py index 14843f8..e3bf921 100644 --- a/catdb.py +++ b/catdb.py @@ -29,7 +29,7 @@ class DBHandler(): def query(self,str): conn = sqlite3.connect(self.DB) cur = conn.cursor() - res = cur.execute(str) + res = cur.execute(str).fetchall() conn.close() return res @@ -42,3 +42,14 @@ class DBHandler(): except Exception as e: print("ERROR ","failed to insert event to the db, ignoring ",e) + def count_interaction(self): + try: + res = self.query(QUERY_COUNT_INTERACTION) + return dict(res) + except: + print("query failed") + return None + + + + -- cgit v1.2.3-70-g09d2