mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 18:07:03 +05:30
feat(database): add support for marking posts as read
This commit is contained in:
parent
1394bc74c4
commit
9c32d6721b
4 changed files with 58 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE ReadPosts(
|
||||
id TEXT NOT NULL PRIMARY KEY
|
||||
);
|
||||
|
||||
markRead:
|
||||
INSERT OR REPLACE
|
||||
INTO ReadPosts(id)
|
||||
VALUES (?);
|
||||
|
||||
markUnread:
|
||||
DELETE FROM ReadPosts
|
||||
WHERE id = ?;
|
||||
|
||||
isRead:
|
||||
SELECT *
|
||||
FROM ReadPosts
|
||||
WHERE id = ?;
|
3
database/src/main/sqldelight/migrations/5.sqm
Normal file
3
database/src/main/sqldelight/migrations/5.sqm
Normal file
|
@ -0,0 +1,3 @@
|
|||
CREATE TABLE ReadPosts(
|
||||
id TEXT NOT NULL PRIMARY KEY
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue