mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
refactor(db): Replace some more StorIO queries with SQLDelight
- Manga: db.getManga -> getManga.await* - History - Chapter: db.updateChapter* -> updateChapter.await; db.getChapter -> getChapter.await*
This commit is contained in:
parent
822cfa56a6
commit
5378d2a99b
8 changed files with 81 additions and 33 deletions
|
@ -9,6 +9,26 @@ CREATE TABLE history(
|
|||
|
||||
CREATE INDEX history_history_chapter_id_index ON history(history_chapter_id);
|
||||
|
||||
upsert:
|
||||
INSERT INTO history(history_chapter_id, history_last_read, history_time_read)
|
||||
VALUES(:historyChapterId, :historyLastRead, :historyTimeRead)
|
||||
ON CONFLICT(history_chapter_id)
|
||||
DO UPDATE
|
||||
SET
|
||||
history_last_read = :historyLastRead,
|
||||
history_time_read = :historyTimeRead
|
||||
WHERE history_chapter_id = history_chapter_id;
|
||||
|
||||
selectLastInsertedRowId:
|
||||
SELECT last_insert_rowid();
|
||||
|
||||
getByChapterUrl:
|
||||
SELECT history.*
|
||||
FROM history
|
||||
JOIN chapters
|
||||
ON history.history_chapter_id = chapters._id
|
||||
WHERE chapters.url = :chapterUrl AND history.history_chapter_id = chapters._id;
|
||||
|
||||
getRecentsUngrouped:
|
||||
SELECT
|
||||
M.*,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue