InsertChatDebugStep creates a new step in a debug run. The underlying SQL uses INSERT ... SELECT ... FROM chat_debug_runs to enforce that the run exists and belongs to the specified chat. If the run_id is invalid or the chat_id doesn't match, the INSERT produces 0 rows and SQLC returns sql.ErrNoRo
(ctx context.Context, arg database.InsertChatDebugStepParams)
| 5489 | // or the chat_id doesn't match, the INSERT produces 0 rows and SQLC |
| 5490 | // returns sql.ErrNoRows. |
| 5491 | func (q *querier) InsertChatDebugStep(ctx context.Context, arg database.InsertChatDebugStepParams) (database.ChatDebugStep, error) { |
| 5492 | chat, err := q.db.GetChatByID(ctx, arg.ChatID) |
| 5493 | if err != nil { |
| 5494 | return database.ChatDebugStep{}, err |
| 5495 | } |
| 5496 | if err := q.authorizeContext(ctx, policy.ActionUpdate, chat); err != nil { |
| 5497 | return database.ChatDebugStep{}, err |
| 5498 | } |
| 5499 | return q.db.InsertChatDebugStep(ctx, arg) |
| 5500 | } |
| 5501 | |
| 5502 | func (q *querier) InsertChatFile(ctx context.Context, arg database.InsertChatFileParams) (database.InsertChatFileRow, error) { |
| 5503 | // Authorize create on chat resource scoped to the owner and org. |
nothing calls this directly
no test coverage detected