Remove deprecated WebSocket API, switch to SQLite for reply store

This commit is contained in:
2023-08-18 19:10:43 -07:00
parent a9cddb115f
commit bc91986e6c
12 changed files with 289 additions and 165 deletions

5
sql/queries.sql Normal file
View File

@@ -0,0 +1,5 @@
/* name: ItemExists :one */
SELECT COUNT(1) FROM replied_items WHERE item_type = ? AND id = ? AND updated_time = ?;
/* name: AddItem :exec */
INSERT OR REPLACE INTO replied_items (id, item_type, updated_time) VALUES (?, ?, ?);

6
sql/schema.sql Normal file
View File

@@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS replied_items (
id INT NOT NULL PRIMARY KEY,
item_type TEXT NOT NULL CHECK( item_type IN ('p', 'c') ),
updated_time INT NOT NULL,
UNIQUE(id, item_type)
);