Use SQLDelight on Category screen (#7310)

* Use SQLDelight on Category screen

* Include category name in DuplicateNameException
This commit is contained in:
Andreas
2022-06-16 16:59:10 +02:00
committed by GitHub
parent 602168bc48
commit 017f6b22f0
17 changed files with 286 additions and 56 deletions

View File

@ -11,7 +11,8 @@ _id AS id,
name,
sort AS `order`,
flags
FROM categories;
FROM categories
ORDER BY sort;
getCategoriesByMangaId:
SELECT
@ -28,5 +29,16 @@ insert:
INSERT INTO categories(name, sort, flags)
VALUES (:name, :order, :flags);
delete:
DELETE FROM categories
WHERE _id = :categoryId;
update:
UPDATE categories
SET name = coalesce(:name, name),
sort = coalesce(:order, sort),
flags = coalesce(:flags, flags)
WHERE _id = :categoryId;
selectLastInsertedRowId:
SELECT last_insert_rowid();