feat: add db query for setting interception ended_at field (#20437)

Adds UpdateAIBridgeInterceptionEnded query to mark interceptions as
done.
Needed for https://github.com/coder/internal/issues/1051
This commit is contained in:
Paweł Banaszewski
2025-10-27 09:51:37 +01:00
committed by GitHub
parent 6318520501
commit 50ba223aa1
18 changed files with 196 additions and 23 deletions
+8
View File
@@ -6,6 +6,14 @@ INSERT INTO aibridge_interceptions (
)
RETURNING *;
-- name: UpdateAIBridgeInterceptionEnded :one
UPDATE aibridge_interceptions
SET ended_at = @ended_at::timestamptz
WHERE
id = @id::uuid
AND ended_at IS NULL
RETURNING *;
-- name: InsertAIBridgeTokenUsage :one
INSERT INTO aibridge_token_usages (
id, interception_id, provider_response_id, input_tokens, output_tokens, metadata, created_at