Improve metadata queries

This commit is contained in:
Jobobby04 2022-06-11 13:19:41 -04:00
parent 978a8de32c
commit cf79a406bf
3 changed files with 12 additions and 11 deletions

View File

@ -20,13 +20,21 @@ SELECT * FROM search_metadata WHERE manga_id = ?;
selectByIndexedExtra:
SELECT * FROM search_metadata WHERE indexed_extra = ?;
upsert:
INSERT INTO search_metadata(manga_id, uploader, extra, indexed_extra, extra_version)
VALUES (:mangaId, :uploader, :extra, :indexedExtra, :extraVersion)
ON CONFLICT(manga_id)
DO UPDATE
SET
uploader = :uploader,
extra = :extra,
indexed_extra = :indexedExtra,
extra_version = :extraVersion
WHERE manga_id = :mangaId;
insert:
INSERT INTO search_metadata (manga_id, uploader, extra, indexed_extra, extra_version)
VALUES (?, ?, ?, ?, ?);
insertNew:
INSERT INTO search_metadata (manga_id, uploader, extra, indexed_extra, extra_version)
VALUES ?;
deleteAll:
DELETE FROM search_metadata;

View File

@ -20,10 +20,6 @@ deleteByManga:
DELETE FROM search_tags WHERE manga_id = ?;
insert:
INSERT INTO search_tags (_id, manga_id, namespace, name, type)
VALUES (?, ?, ?, ?, ?);
insertNew:
INSERT INTO search_tags (manga_id, namespace, name, type)
VALUES (?, ?, ?, ?);

View File

@ -18,9 +18,6 @@ deleteByManga:
DELETE FROM search_titles WHERE manga_id = ?;
insert:
INSERT INTO search_titles (_id, manga_id, title, type) VALUES (?, ?, ?, ?);
insertNew:
INSERT INTO search_titles (manga_id, title, type) VALUES (?, ?, ?);
insertItem: