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.
 
 
 
 
 
 

54 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 = ?
AND (
-- from time is within from..to
(from_time <= ? AND to_time > ?)
-- or to time is within from..to
OR (from_time <= ? AND to_time > ?)
-- or from and to time are on each their side of from..to
OR (from_time < ? AND to_time >= ?)
);
-- 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
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
-- name: UpdateSprint :exec
UPDATE sprint
SET name = ?,
description = ?,
from_time = ?,
to_time = ?,
is_timed = ?,
is_coarse = ?,
aggregate_name = ?,
aggregate_required = ?
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 = ?;