mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
refactor(db): Migrate some more category queries to SQLDelight
This commit is contained in:
parent
9c40aadca2
commit
ca41e02fe1
12 changed files with 187 additions and 21 deletions
|
@ -15,3 +15,22 @@ findAllByMangaId:
|
|||
SELECT categories.* FROM categories
|
||||
JOIN mangas_categories ON categories._id = mangas_categories.category_id
|
||||
WHERE mangas_categories.manga_id = :mangaId;
|
||||
|
||||
insert:
|
||||
INSERT INTO categories (name, sort, flags, manga_order)
|
||||
VALUES (:name, :sort, :flags, :mangaOrder);
|
||||
|
||||
selectLastInsertedRowId:
|
||||
SELECT last_insert_rowid();
|
||||
|
||||
update:
|
||||
UPDATE categories SET
|
||||
name = coalesce(:name, name),
|
||||
sort = coalesce(:sort, sort),
|
||||
flags = coalesce(:flags, flags),
|
||||
manga_order = coalesce(:mangaOrder, manga_order)
|
||||
WHERE _id = :id;
|
||||
|
||||
delete:
|
||||
DELETE FROM categories
|
||||
WHERE _id = :id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue