1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-10 04:52:38 +01:00

Add notifications sq

This commit is contained in:
Allan Wang 2023-06-18 15:49:04 -07:00
parent 3c0a8b3fb9
commit 749c00cfde
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
3 changed files with 27 additions and 3 deletions

View File

@ -281,6 +281,7 @@ sqldelight {
databases {
register("FrostDb") {
packageName.set("com.pitchedapps.frost.db")
schemaOutputDirectory.set(file("src/main/sqldelight/databases"))
}
}
}

View File

@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS account (
id INTEGER NOT NULL PRIMARY KEY,
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT,
avatar TEXT,
facebook_cookie TEXT,
@ -15,8 +15,10 @@ INSERT INTO account DEFAULT VALUES;
insert:
INSERT OR REPLACE INTO account (id, name, avatar, facebook_cookie, messenger_cookie) VALUES (?, ?, ?, ?, ?);
delete:
DELETE FROM account WHERE id == ?;
delete {
DELETE FROM account WHERE id == (:id);
DELETE FROM notifications WHERE id == (:id);
}
select:
SELECT *

View File

@ -0,0 +1,21 @@
CREATE TABLE IF NOT EXISTS notifications (
id INTEGER NOT NULL PRIMARY KEY,
facebook_notifications INTEGER,
facebook_messages INTEGER,
facebook_friends INTEGER,
messenger_notifications INTEGER
);
insertNew:
INSERT OR IGNORE INTO notifications (id) VALUES (?);
insert:
INSERT OR REPLACE INTO notifications (id,facebook_notifications, facebook_messages, facebook_friends, messenger_notifications) VALUES (?,?,?,?,?);
select:
SELECT *
FROM notifications WHERE id == ?;
selectAll:
SELECT *
FROM notifications;