mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
refactor(db): Migrate clear database queries to SQLDelight
This commit is contained in:
parent
cf06ebdb8b
commit
da1f60c5c5
7 changed files with 24 additions and 125 deletions
|
@ -87,8 +87,17 @@ WHERE _id = :mangaId;
|
|||
selectLastInsertedRowId:
|
||||
SELECT last_insert_rowid();
|
||||
|
||||
deleteNotInLibraryBySourceIds:
|
||||
DELETE FROM mangas
|
||||
WHERE favorite = 0 AND source IN :sourceIds;
|
||||
|
||||
deleteNotInLibraryAndNotReadBySourceIds:
|
||||
DELETE FROM mangas
|
||||
WHERE favorite = :favorite AND source IN :sourceIds AND _id NOT IN (
|
||||
WHERE favorite = 0 AND source IN :sourceIds AND _id NOT IN (
|
||||
SELECT chapters.manga_id FROM chapters WHERE read = 1 OR last_page_read != 0
|
||||
);
|
||||
|
||||
getSourceIdsOfNotInLibrary:
|
||||
SELECT source, count(*) AS count
|
||||
FROM mangas WHERE favorite = 0
|
||||
GROUP BY source;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue