2022-11-29 19:55:00 -07:00
|
|
|
-- name: AddOwner :one
|
|
|
|
insert into owners (id, name)
|
|
|
|
values (?, ?) returning *;
|
|
|
|
|
|
|
|
-- name: GetOwner :one
|
|
|
|
select *
|
|
|
|
from owners
|
|
|
|
where id = ?;
|
|
|
|
|
|
|
|
-- name: GetAllWatchItems :many
|
|
|
|
select *
|
|
|
|
from watch_items;
|
|
|
|
|
|
|
|
-- name: GetAllWatchItemsByOwner :many
|
|
|
|
select *
|
|
|
|
from watch_items
|
|
|
|
where owner_id = ?;
|
|
|
|
|
|
|
|
-- name: AddWatchItem :one
|
2022-12-02 20:53:05 -07:00
|
|
|
insert into watch_items (owner_id, name, repo)
|
|
|
|
values (?, ?, ?) returning *;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: DeleteWatchItem :exec
|
2022-11-29 20:47:23 -07:00
|
|
|
delete
|
|
|
|
from watch_items
|
|
|
|
where id = ?
|
|
|
|
and owner_id = ?;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
2022-12-02 20:53:05 -07:00
|
|
|
-- name: GetAllLinksForOwner :many
|
2022-11-29 19:55:00 -07:00
|
|
|
select *
|
|
|
|
from links
|
|
|
|
where owner_id = ?;
|
|
|
|
|
2022-12-02 20:53:05 -07:00
|
|
|
-- name: GetAllLinks :many
|
|
|
|
select *
|
|
|
|
from links;
|
|
|
|
|
2022-11-29 19:55:00 -07:00
|
|
|
-- name: AddLink :one
|
|
|
|
insert into links (owner_id, url, name, logo_url)
|
|
|
|
values (?, ?, ?, ?) returning *;
|
|
|
|
|
2022-12-05 15:45:39 -07:00
|
|
|
-- name: GetLinkByID :one
|
|
|
|
select * from links where id = ?;
|
|
|
|
|
2022-11-29 19:55:00 -07:00
|
|
|
-- name: DeleteLink :exec
|
2022-11-29 20:47:23 -07:00
|
|
|
delete
|
|
|
|
from links
|
|
|
|
where id = ?
|
|
|
|
and owner_id = ?;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: GetAllIcons :many
|
|
|
|
select *
|
|
|
|
from icons
|
|
|
|
where owner_id = ?;
|
|
|
|
|
2022-12-02 20:53:05 -07:00
|
|
|
-- name: GetIconByLinkID :one
|
|
|
|
select *
|
|
|
|
from icons
|
|
|
|
where owner_id = ?
|
|
|
|
and link_id = ?;
|
|
|
|
|
|
|
|
-- name: AddIcon :exec
|
|
|
|
insert
|
|
|
|
into icons (owner_id, link_id, content_type, data)
|
|
|
|
values (?, ?, ?, ?) on conflict(link_id) do
|
|
|
|
update set data = excluded.data, content_type = excluded.content_type;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: GetAllPullRequests :many
|
|
|
|
select *
|
|
|
|
from pull_requests
|
2022-12-05 09:14:30 -07:00
|
|
|
where owner_id = ?;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: AddPullRequest :one
|
2022-12-05 09:14:30 -07:00
|
|
|
insert into pull_requests (owner_id, number, repo, description, url)
|
|
|
|
values (?, ?, ?, ?, ?) returning *;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: DeletePullRequest :exec
|
2022-11-29 20:47:23 -07:00
|
|
|
delete
|
|
|
|
from pull_requests
|
|
|
|
where id = ?
|
|
|
|
and owner_id = ?;
|
2022-11-29 19:55:00 -07:00
|
|
|
|
|
|
|
-- name: GetAllPullRequestIgnores :many
|
|
|
|
select *
|
|
|
|
from pull_request_ignores
|
|
|
|
where owner_id = ?;
|
|
|
|
|
|
|
|
-- name: AddPullRequestIgnore :one
|
|
|
|
insert into pull_request_ignores (owner_id, number, repo)
|
|
|
|
values (?, ?, ?) returning *;
|