Loggest thine Stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.5 KiB

-- name: ListSprintsAt :many
SELECT *
FROM sprint
WHERE scope_id = ?
AND from_time <= sqlc.arg(time)
AND to_time > sqlc.arg(time);
-- name: ListSprintsBetween :many
SELECT *
FROM sprint
WHERE scope_id = sqlc.arg(scope_id)
AND from_time < sqlc.arg(to_time)
AND to_time >= sqlc.arg(from_time)
ORDER BY from_time, name;
-- name: GetSprint :one
SELECT *
FROM sprint
WHERE id = ?
AND scope_id = ?;
-- name: InsertSprint :execresult
INSERT INTO sprint (scope_id, name, description, kind, from_time, to_time,
is_timed, is_coarse, aggregate_name, aggregate_required,
is_unweighted, tags_csv)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
-- name: UpdateSprint :exec
UPDATE sprint
SET name = ?,
description = ?,
from_time = ?,
to_time = ?,
is_timed = ?,
is_coarse = ?,
is_unweighted = ?,
aggregate_name = ?,
aggregate_required = ?,
tags_csv = ?
WHERE id = ?;
-- name: DeleteSprint :exec
DELETE
FROM sprint
WHERE id = ?;
-- name: DeleteAllScopeSprints :exec
DELETE
FROM sprint
WHERE scope_id = ?;
-- name: ListSprintParts :many
SELECT *
FROM sprint_part
WHERE sprint_id = ?;
-- name: ReplaceSprintPart :exec
REPLACE INTO sprint_part (sprint_id, object_id, required)
VALUES (?, ?, ?);
-- name: DeleteSprintPart :exec
DELETE
FROM sprint_part
WHERE sprint_id = ?
AND object_id = ?;
-- name: DeleteAllSprintParts :exec
DELETE
FROM sprint_part
WHERE sprint_id = ?;