feat(workspace): sqlc queries for workspace/worktree/credential

This commit is contained in:
2026-05-02 07:07:33 +08:00
parent e5800ef5dc
commit 08845f92d7
9 changed files with 838 additions and 0 deletions
@@ -0,0 +1,13 @@
-- name: UpsertCredential :one
INSERT INTO git_credentials (id, workspace_id, kind, username, encrypted_secret, fingerprint)
VALUES ($1,$2,$3,$4,$5,$6)
ON CONFLICT (workspace_id) DO UPDATE
SET kind = EXCLUDED.kind,
username = EXCLUDED.username,
encrypted_secret = EXCLUDED.encrypted_secret,
fingerprint = EXCLUDED.fingerprint,
updated_at = now()
RETURNING *;
-- name: GetCredentialByWorkspace :one
SELECT * FROM git_credentials WHERE workspace_id = $1;