35 lines
693 B
Go
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;
|
|
`
|
|
)
|