pkgdash/internal/storage/sqlite/queries.go
Vasiliy Tolstov 78f0ae14d7 rewrite
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-08-16 13:17:42 +03:00

35 lines
693 B
Go

package sqlite
const (
queryPackagesList = `select
id,
name,
url,
comments
modules,
issues,
from package;
`
queryCommentsCreate = `
insert into comment(text) values ($1) returning id;
update package
set comments = json_insert(comments, '$[#]', ( select last_insert_rowid() as id from comment ))
where id = $2 ;
`
queryPackagesCreate = `
insert into package(name, url, modules) values ($1, $2, $3);
`
queryInsMsgGetIDs = `
insert into module(name, version, last_version) values
%s
returning id;
`
queryModulesList = `
select id, name, version, last_version, created, updated from modules;
`
queryCommentsList = `
select id, text, created, updated from comments;
`
)