33 lines
598 B
Go
33 lines
598 B
Go
package sqlite
|
|
|
|
const (
|
|
queryListPackage = `
|
|
select
|
|
id,
|
|
name,
|
|
url,
|
|
comments
|
|
--modules,
|
|
--issues,
|
|
from package;
|
|
`
|
|
queryAddComment = `
|
|
insert into comment(text) values ($1) ;
|
|
update package
|
|
set comments = json_insert(comments, '$[#]', ( select last_insert_rowid() as id from comment ))
|
|
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;
|
|
`
|
|
queryGetModule = `
|
|
select id, name, version, last_version from module
|
|
where id in %s ;
|
|
`
|
|
)
|