2023-08-10 22:16:14 +03:00
|
|
|
package sqlite
|
|
|
|
|
|
|
|
const (
|
2023-08-16 13:17:42 +03:00
|
|
|
queryPackagesList = `select
|
2023-08-10 22:16:14 +03:00
|
|
|
id,
|
|
|
|
name,
|
|
|
|
url,
|
|
|
|
comments
|
2023-08-16 13:17:42 +03:00
|
|
|
modules,
|
|
|
|
issues,
|
2023-08-10 22:16:14 +03:00
|
|
|
from package;
|
|
|
|
`
|
2023-08-16 13:17:42 +03:00
|
|
|
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 ;
|
|
|
|
`
|
2023-08-16 13:17:42 +03:00
|
|
|
queryPackagesCreate = `
|
2023-08-10 22:16:14 +03:00
|
|
|
insert into package(name, url, modules) values ($1, $2, $3);
|
|
|
|
`
|
|
|
|
queryInsMsgGetIDs = `
|
2023-08-16 13:17:42 +03:00
|
|
|
insert into module(name, version, last_version) values
|
2023-08-10 22:16:14 +03:00
|
|
|
%s
|
|
|
|
returning id;
|
2023-08-11 16:24:16 +03:00
|
|
|
`
|
2023-08-16 13:17:42 +03:00
|
|
|
queryModulesList = `
|
|
|
|
select id, name, version, last_version, created, updated from modules;
|
2023-08-14 14:27:29 +03:00
|
|
|
`
|
|
|
|
|
2023-08-16 13:17:42 +03:00
|
|
|
queryCommentsList = `
|
|
|
|
select id, text, created, updated from comments;
|
2023-08-10 22:16:14 +03:00
|
|
|
`
|
|
|
|
)
|