// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 // source: workflow_step_log_chunks.sql package actionsdb import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const appendStepLogChunk = `-- name: AppendStepLogChunk :one INSERT INTO workflow_step_log_chunks (step_id, seq, chunk) VALUES ($1, $2, $3) RETURNING id, step_id, seq, created_at ` type AppendStepLogChunkParams struct { StepID int64 Seq int32 Chunk []byte } type AppendStepLogChunkRow struct { ID int64 StepID int64 Seq int32 CreatedAt pgtype.Timestamptz } // SPDX-License-Identifier: AGPL-3.0-or-later func (q *Queries) AppendStepLogChunk(ctx context.Context, db DBTX, arg AppendStepLogChunkParams) (AppendStepLogChunkRow, error) { row := db.QueryRow(ctx, appendStepLogChunk, arg.StepID, arg.Seq, arg.Chunk) var i AppendStepLogChunkRow err := row.Scan( &i.ID, &i.StepID, &i.Seq, &i.CreatedAt, ) return i, err } const deleteStepLogChunks = `-- name: DeleteStepLogChunks :exec DELETE FROM workflow_step_log_chunks WHERE step_id = $1 ` func (q *Queries) DeleteStepLogChunks(ctx context.Context, db DBTX, stepID int64) error { _, err := db.Exec(ctx, deleteStepLogChunks, stepID) return err } const listStepLogChunks = `-- name: ListStepLogChunks :many SELECT id, step_id, seq, chunk, created_at FROM workflow_step_log_chunks WHERE step_id = $1 AND seq > $2 ORDER BY seq ASC LIMIT $3 ` type ListStepLogChunksParams struct { StepID int64 Seq int32 Limit int32 } func (q *Queries) ListStepLogChunks(ctx context.Context, db DBTX, arg ListStepLogChunksParams) ([]WorkflowStepLogChunk, error) { rows, err := db.Query(ctx, listStepLogChunks, arg.StepID, arg.Seq, arg.Limit) if err != nil { return nil, err } defer rows.Close() items := []WorkflowStepLogChunk{} for rows.Next() { var i WorkflowStepLogChunk if err := rows.Scan( &i.ID, &i.StepID, &i.Seq, &i.Chunk, &i.CreatedAt, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil }