2023-08-19 17:33:25 +03:00
|
|
|
//go:build ignore
|
|
|
|
|
2023-08-09 14:31:23 +03:00
|
|
|
package postgres
|
|
|
|
|
|
|
|
const (
|
|
|
|
queryListPackage = `
|
2023-08-11 20:12:15 +03:00
|
|
|
select
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
url,
|
|
|
|
comments
|
|
|
|
--modules,
|
|
|
|
--issues,
|
|
|
|
from package;
|
|
|
|
`
|
|
|
|
queryAddComment = `
|
|
|
|
with insert_comm as (
|
|
|
|
insert into comment(text) values ($1) returning id
|
|
|
|
)
|
|
|
|
update package set comments = array_append(comments, (select * from insert_comm)) where id=$2;
|
|
|
|
`
|
|
|
|
queryAddPackage = `
|
|
|
|
insert into package(name, url, modules) values ($1, $2, $3);
|
|
|
|
`
|
|
|
|
queryInsMsgGetIDs = `
|
|
|
|
insert into module(name, version, last_version) values
|
|
|
|
%s
|
|
|
|
returning id;
|
2023-08-12 19:26:50 +03:00
|
|
|
`
|
|
|
|
queryGetModule = `
|
|
|
|
select id, name, version, last_version from module
|
|
|
|
where id in %s ;
|
2023-08-09 14:31:23 +03:00
|
|
|
`
|
|
|
|
)
|