This commit is contained in:
2026-06-22 08:55:57 +08:00
parent dbb87823e8
commit 6ade6e8fa9
325 changed files with 41131 additions and 855 deletions
+4 -2
View File
@@ -12,7 +12,7 @@ import (
)
const getCredentialByWorkspace = `-- name: GetCredentialByWorkspace :one
SELECT id, workspace_id, kind, username, encrypted_secret, fingerprint, created_at, updated_at FROM git_credentials WHERE workspace_id = $1
SELECT id, workspace_id, kind, username, encrypted_secret, fingerprint, created_at, updated_at, key_version FROM git_credentials WHERE workspace_id = $1
`
func (q *Queries) GetCredentialByWorkspace(ctx context.Context, workspaceID pgtype.UUID) (GitCredential, error) {
@@ -27,6 +27,7 @@ func (q *Queries) GetCredentialByWorkspace(ctx context.Context, workspaceID pgty
&i.Fingerprint,
&i.CreatedAt,
&i.UpdatedAt,
&i.KeyVersion,
)
return i, err
}
@@ -40,7 +41,7 @@ ON CONFLICT (workspace_id) DO UPDATE
encrypted_secret = EXCLUDED.encrypted_secret,
fingerprint = EXCLUDED.fingerprint,
updated_at = now()
RETURNING id, workspace_id, kind, username, encrypted_secret, fingerprint, created_at, updated_at
RETURNING id, workspace_id, kind, username, encrypted_secret, fingerprint, created_at, updated_at, key_version
`
type UpsertCredentialParams struct {
@@ -71,6 +72,7 @@ func (q *Queries) UpsertCredential(ctx context.Context, arg UpsertCredentialPara
&i.Fingerprint,
&i.CreatedAt,
&i.UpdatedAt,
&i.KeyVersion,
)
return i, err
}