diff options
| author | Tianhao Wang <shrik3@riseup.net> | 2023-03-29 15:30:14 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@riseup.net> | 2023-03-29 15:30:14 +0200 |
| commit | a05d9ccfd06059aef9ebd2608f16fc0953cf5ab1 (patch) | |
| tree | eb28ad77d6ef2b18ce38ba70e42a8087cda29f3f /catdb.py | |
| parent | 04c0fd709b868400a826bca05c679a8c4f1abb8d (diff) | |
count intimacy, untested
Diffstat (limited to 'catdb.py')
| -rw-r--r-- | catdb.py | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 + + + + |
