mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 19:57:04 +05:30
refactor: improve read posts search performance
This commit is contained in:
parent
89b821ebf1
commit
cbd7f2fca4
6 changed files with 31 additions and 44 deletions
|
@ -2,16 +2,15 @@ CREATE TABLE ReadPosts(
|
|||
id TEXT NOT NULL PRIMARY KEY
|
||||
);
|
||||
|
||||
selectAllPosts:
|
||||
SELECT *
|
||||
FROM ReadPosts;
|
||||
|
||||
markRead:
|
||||
INSERT OR REPLACE
|
||||
INSERT OR IGNORE
|
||||
INTO ReadPosts(id)
|
||||
VALUES (?);
|
||||
|
||||
markUnread:
|
||||
DELETE FROM ReadPosts
|
||||
WHERE id = ?;
|
||||
|
||||
isRead:
|
||||
SELECT *
|
||||
FROM ReadPosts
|
||||
WHERE id = ?;
|
||||
|
|
|
@ -36,8 +36,3 @@ deletePost:
|
|||
DELETE
|
||||
FROM SavedPost
|
||||
WHERE shortId = ?;
|
||||
|
||||
selectPost:
|
||||
SELECT *
|
||||
FROM SavedPost
|
||||
WHERE shortId = ?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue