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

Method InsertChatDebugStep

coderd/database/querier.go:946–946  ·  view source on GitHub ↗

The CTE atomically locks the parent run via UPDATE, bumps its updated_at (eliminating a separate TouchChatDebugRunUpdatedAt call), and enforces the finalization guard: if the run is already finished, the UPDATE returns zero rows, the INSERT gets no source rows, and sql.ErrNoRows is returned. The UPD

(ctx context.Context, arg InsertChatDebugStepParams)

Source from the content-addressed store, hash-verified

944 // rows, and sql.ErrNoRows is returned. The UPDATE also serializes
945 // with concurrent FinalizeStale under READ COMMITTED isolation.
946 InsertChatDebugStep(ctx context.Context, arg InsertChatDebugStepParams) (ChatDebugStep, error)
947 InsertChatFile(ctx context.Context, arg InsertChatFileParams) (InsertChatFileRow, error)
948 InsertChatMessages(ctx context.Context, arg InsertChatMessagesParams) ([]ChatMessage, error)
949 InsertChatModelConfig(ctx context.Context, arg InsertChatModelConfigParams) (ChatModelConfig, error)

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls