pkgdash/internal/storage/sqlite/queries.go
Vasiliy Tolstov 0e18a63f10 use worker
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-08-18 23:59:15 +03:00

15 lines
1.2 KiB
Go

package sqlite
const (
queryPackagesProcess = `select id, name, url, comments, modules, issues, created, updated from packages where ROUND((JULIANDAY(CURRENT_TIMESTAMP) - JULIANDAY(last_check)) * 86400) > $1 or last_check is NULL`
queryPackagesModulesCount = `update packages set modules = $2, last_check = CURRENT_TIMESTAMP where id = $1;`
queryPackagesList = `select id, name, url, comments, modules, issues, created, updated from packages;`
queryPackagesLookup = `select id, name, url, comments, modules, issues, created, updated from packages where id = $1;`
queryCommentsCreate = `insert into comments (comment) values ($1) returning id;`
queryPackagesCreate = `insert into packages (name, url) values ($1, $2) returning *;`
queryInsMsgGetIDs = `insert into modules(name, version, last_version) values %s returning id;`
queryModulesList = `select id, name, version, last_version, created, updated from modules;`
queryModulesCreate = `insert into modules (name, version, last_version, package) values ($1, $2, $3, $4) returning *;`
queryCommentsList = `select id, text, created, updated from comments;`
)