2023-08-09 14:31:23 +03:00
|
|
|
package postgres
|
|
|
|
|
|
|
|
const (
|
|
|
|
queryListPackage = `
|
2023-08-10 12:38:55 +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);
|
2023-08-09 14:31:23 +03:00
|
|
|
`
|
|
|
|
)
|