mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
36 lines
451 B
SQL
36 lines
451 B
SQL
-- name: InsertGitSSHKey :one
|
|
INSERT INTO
|
|
gitsshkeys (
|
|
user_id,
|
|
created_at,
|
|
updated_at,
|
|
private_key,
|
|
public_key
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4, $5) RETURNING *;
|
|
|
|
-- name: GetGitSSHKey :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
gitsshkeys
|
|
WHERE
|
|
user_id = $1;
|
|
|
|
-- name: UpdateGitSSHKey :exec
|
|
UPDATE
|
|
gitsshkeys
|
|
SET
|
|
updated_at = $2,
|
|
private_key = $3,
|
|
public_key = $4
|
|
WHERE
|
|
user_id = $1;
|
|
|
|
-- name: DeleteGitSSHKey :exec
|
|
DELETE FROM
|
|
gitsshkeys
|
|
WHERE
|
|
user_id = $1;
|