MCPcopy Index your code
hub / github.com/coder/coder / InsertChatDebugStep

Method InsertChatDebugStep

coderd/database/dbauthz/dbauthz.go:5491–5500  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5489// or the chat_id doesn't match, the INSERT produces 0 rows and SQLC
5490// returns sql.ErrNoRows.
5491func (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
5502func (q *querier) InsertChatFile(ctx context.Context, arg database.InsertChatFileParams) (database.InsertChatFileRow, error) {
5503 // Authorize create on chat resource scoped to the owner and org.

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetChatByIDMethod · 0.65
InsertChatDebugStepMethod · 0.65

Tested by

no test coverage detected