diff options
| author | Tianhao Wang <wth@riseup.net> | 2024-01-11 13:50:41 +0000 |
|---|---|---|
| committer | Tianhao Wang <wth@riseup.net> | 2024-01-11 13:50:41 +0000 |
| commit | 7b3ef7a4726ba1e76f99b8569767aea5be99a1f5 (patch) | |
| tree | 5261d467e164e6542921ad35a29738d26f572123 /catquery.py | |
| parent | ebc18cf2aa3d486b744bceba1ae1479672b8bddd (diff) | |
interactions based on intimacy
Diffstat (limited to 'catquery.py')
| -rw-r--r-- | catquery.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/catquery.py b/catquery.py index 12921c4..10d5b37 100644 --- a/catquery.py +++ b/catquery.py @@ -21,3 +21,28 @@ SELECT correspond, count(correspond) FROM events GROUP by correspond """ + + +DB_SCHEMA_INT = \ +""" +CREATE TABLE IF NOT EXISTS + intimacy( + correspond TEXT PRIMARY KEY, + score INTEGER + ) + +""" + +QUERY_UPDATE_INT = \ +""" +INSERT INTO intimacy(correspond,score) + VALUES(?1, 0) + ON CONFLICT(correspond) DO UPDATE SET + score=score+1 + WHERE correspond=?2 +""" + +QUERY_GET_INT = \ +""" +SELECT correspond, score FROM intimacy; +""" |
