taskcafe/api/query/project.sql

15 lines
429 B
MySQL
Raw Normal View History

2020-04-10 04:40:22 +02:00
-- name: GetAllProjects :many
SELECT * FROM project;
-- name: GetAllProjectsForTeam :many
SELECT * FROM project WHERE team_id = $1;
-- name: GetProjectByID :one
SELECT * FROM project WHERE project_id = $1;
-- name: CreateProject :one
2020-04-20 05:02:55 +02:00
INSERT INTO project(owner, team_id, created_at, name) VALUES ($1, $2, $3, $4) RETURNING *;
2020-05-31 06:11:19 +02:00
-- name: UpdateProjectNameByID :one
UPDATE project SET name = $2 WHERE project_id = $1 RETURNING *;