Maintain source info in the database. (#6389)

* Maintain Source Info in database

* Review changes and cleanups

* Review changes 2

* Review Changes 3
This commit is contained in:
AntsyLich
2022-06-14 19:10:40 +06:00
committed by GitHub
parent a01c370d63
commit 9d5b7de1d8
28 changed files with 307 additions and 48 deletions

View File

@ -0,0 +1,20 @@
CREATE TABLE sources(
_id INTEGER NOT NULL PRIMARY KEY,
lang TEXT NOT NULL,
name TEXT NOT NULL
);
getSourceData:
SELECT *
FROM sources
WHERE _id = :id;
upsert:
INSERT INTO sources(_id, lang, name)
VALUES (:id, :lang, :name)
ON CONFLICT(_id)
DO UPDATE
SET
lang = :lang,
name = :name
WHERE _id = :id;