pkgdash/internal/storage/sqlite/queries.go

35 lines
693 B
Go
Raw Normal View History

2023-08-10 22:16:14 +03:00
package sqlite
const (
queryPackagesList = `select
2023-08-10 22:16:14 +03:00
id,
name,
url,
comments
modules,
issues,
2023-08-10 22:16:14 +03:00
from package;
`
queryCommentsCreate = `
2023-08-12 19:26:50 +03:00
insert into comment(text) values ($1) returning id;
2023-08-10 22:16:14 +03:00
update package
set comments = json_insert(comments, '$[#]', ( select last_insert_rowid() as id from comment ))
where id = $2 ;
`
queryPackagesCreate = `
2023-08-10 22:16:14 +03:00
insert into package(name, url, modules) values ($1, $2, $3);
`
queryInsMsgGetIDs = `
insert into module(name, version, last_version) values
2023-08-10 22:16:14 +03:00
%s
returning id;
`
queryModulesList = `
select id, name, version, last_version, created, updated from modules;
2023-08-14 14:27:29 +03:00
`
queryCommentsList = `
select id, text, created, updated from comments;
2023-08-10 22:16:14 +03:00
`
)