// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 // source: workflow_runs.sql package actionsdb import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const completeWorkflowRun = `-- name: CompleteWorkflowRun :one UPDATE workflow_runs SET status = 'completed', conclusion = $2::check_conclusion, started_at = COALESCE(started_at, now()), completed_at = COALESCE(completed_at, now()), version = version + 1, updated_at = now() WHERE id = $1 RETURNING id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id ` type CompleteWorkflowRunParams struct { ID int64 Conclusion CheckConclusion } func (q *Queries) CompleteWorkflowRun(ctx context.Context, db DBTX, arg CompleteWorkflowRunParams) (WorkflowRun, error) { row := db.QueryRow(ctx, completeWorkflowRun, arg.ID, arg.Conclusion) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const countWorkflowRunsForRepo = `-- name: CountWorkflowRunsForRepo :one SELECT COUNT(*)::bigint FROM workflow_runs r LEFT JOIN users u ON u.id = r.actor_user_id WHERE r.repo_id = $1::bigint AND ($2::text IS NULL OR r.workflow_file = $2::text) AND ($3::text IS NULL OR r.head_ref = $3::text) AND ($4::workflow_run_event IS NULL OR r.event = $4::workflow_run_event) AND ($5::workflow_run_status IS NULL OR r.status = $5::workflow_run_status) AND ($6::check_conclusion IS NULL OR r.conclusion = $6::check_conclusion) AND ($7::text IS NULL OR u.username = $7::citext) ` type CountWorkflowRunsForRepoParams struct { RepoID int64 WorkflowFile pgtype.Text HeadRef pgtype.Text Event NullWorkflowRunEvent Status NullWorkflowRunStatus Conclusion NullCheckConclusion ActorUsername pgtype.Text } func (q *Queries) CountWorkflowRunsForRepo(ctx context.Context, db DBTX, arg CountWorkflowRunsForRepoParams) (int64, error) { row := db.QueryRow(ctx, countWorkflowRunsForRepo, arg.RepoID, arg.WorkflowFile, arg.HeadRef, arg.Event, arg.Status, arg.Conclusion, arg.ActorUsername, ) var column_1 int64 err := row.Scan(&column_1) return column_1, err } const deleteOldWorkflowRunsForCleanup = `-- name: DeleteOldWorkflowRunsForCleanup :execrows DELETE FROM workflow_runs WHERE pinned = false AND status IN ('completed', 'cancelled') AND completed_at IS NOT NULL AND completed_at < $1 ` func (q *Queries) DeleteOldWorkflowRunsForCleanup(ctx context.Context, db DBTX, completedAt pgtype.Timestamptz) (int64, error) { result, err := db.Exec(ctx, deleteOldWorkflowRunsForCleanup, completedAt) if err != nil { return 0, err } return result.RowsAffected(), nil } const enqueueWorkflowRun = `-- name: EnqueueWorkflowRun :one INSERT INTO workflow_runs ( repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, need_approval, trigger_event_id ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 ) ON CONFLICT (repo_id, workflow_file, trigger_event_id) WHERE trigger_event_id <> '' DO NOTHING RETURNING id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id ` type EnqueueWorkflowRunParams struct { RepoID int64 RunIndex int64 WorkflowFile string WorkflowName string HeadSha string HeadRef string Event WorkflowRunEvent EventPayload []byte ActorUserID pgtype.Int8 ParentRunID pgtype.Int8 ConcurrencyGroup string NeedApproval bool TriggerEventID string } // Idempotent insert: if a row with the same (repo_id, workflow_file, // trigger_event_id) already exists, returns no rows (pgx.ErrNoRows in // Go). The handler treats that as a successful no-op so worker // retries and admin replays of the same triggering event don't // duplicate runs. // // The ON CONFLICT predicate matches the partial unique index defined // in migration 0051; both must agree for postgres to infer the // target. func (q *Queries) EnqueueWorkflowRun(ctx context.Context, db DBTX, arg EnqueueWorkflowRunParams) (WorkflowRun, error) { row := db.QueryRow(ctx, enqueueWorkflowRun, arg.RepoID, arg.RunIndex, arg.WorkflowFile, arg.WorkflowName, arg.HeadSha, arg.HeadRef, arg.Event, arg.EventPayload, arg.ActorUserID, arg.ParentRunID, arg.ConcurrencyGroup, arg.NeedApproval, arg.TriggerEventID, ) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const getWorkflowRunByID = `-- name: GetWorkflowRunByID :one SELECT id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id FROM workflow_runs WHERE id = $1 ` func (q *Queries) GetWorkflowRunByID(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) { row := db.QueryRow(ctx, getWorkflowRunByID, id) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const getWorkflowRunForRepoByIndex = `-- name: GetWorkflowRunForRepoByIndex :one SELECT r.id, r.repo_id, r.run_index, r.workflow_file, r.workflow_name, r.head_sha, r.head_ref, r.event, r.event_payload, r.actor_user_id, COALESCE(u.username::text, '')::text AS actor_username, r.parent_run_id, r.concurrency_group, r.status, r.conclusion, r.pinned, r.need_approval, r.approved_by_user_id, r.started_at, r.completed_at, r.version, r.created_at, r.updated_at, r.trigger_event_id FROM workflow_runs r LEFT JOIN users u ON u.id = r.actor_user_id WHERE r.repo_id = $1 AND r.run_index = $2 ` type GetWorkflowRunForRepoByIndexParams struct { RepoID int64 RunIndex int64 } type GetWorkflowRunForRepoByIndexRow struct { ID int64 RepoID int64 RunIndex int64 WorkflowFile string WorkflowName string HeadSha string HeadRef string Event WorkflowRunEvent EventPayload []byte ActorUserID pgtype.Int8 ActorUsername string ParentRunID pgtype.Int8 ConcurrencyGroup string Status WorkflowRunStatus Conclusion NullCheckConclusion Pinned bool NeedApproval bool ApprovedByUserID pgtype.Int8 StartedAt pgtype.Timestamptz CompletedAt pgtype.Timestamptz Version int32 CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz TriggerEventID string } func (q *Queries) GetWorkflowRunForRepoByIndex(ctx context.Context, db DBTX, arg GetWorkflowRunForRepoByIndexParams) (GetWorkflowRunForRepoByIndexRow, error) { row := db.QueryRow(ctx, getWorkflowRunForRepoByIndex, arg.RepoID, arg.RunIndex) var i GetWorkflowRunForRepoByIndexRow err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ActorUsername, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const insertWorkflowRun = `-- name: InsertWorkflowRun :one INSERT INTO workflow_runs ( repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, need_approval ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12 ) RETURNING id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id ` type InsertWorkflowRunParams struct { RepoID int64 RunIndex int64 WorkflowFile string WorkflowName string HeadSha string HeadRef string Event WorkflowRunEvent EventPayload []byte ActorUserID pgtype.Int8 ParentRunID pgtype.Int8 ConcurrencyGroup string NeedApproval bool } // SPDX-License-Identifier: AGPL-3.0-or-later func (q *Queries) InsertWorkflowRun(ctx context.Context, db DBTX, arg InsertWorkflowRunParams) (WorkflowRun, error) { row := db.QueryRow(ctx, insertWorkflowRun, arg.RepoID, arg.RunIndex, arg.WorkflowFile, arg.WorkflowName, arg.HeadSha, arg.HeadRef, arg.Event, arg.EventPayload, arg.ActorUserID, arg.ParentRunID, arg.ConcurrencyGroup, arg.NeedApproval, ) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const listActiveWorkflowRunsForAdmin = `-- name: ListActiveWorkflowRunsForAdmin :many SELECT id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id FROM workflow_runs WHERE status IN ('queued', 'running') AND ($1::bigint = 0 OR repo_id = $1::bigint) ORDER BY created_at ASC, id ASC LIMIT $2::int ` type ListActiveWorkflowRunsForAdminParams struct { RepoID int64 LimitCount int32 } func (q *Queries) ListActiveWorkflowRunsForAdmin(ctx context.Context, db DBTX, arg ListActiveWorkflowRunsForAdminParams) ([]WorkflowRun, error) { rows, err := db.Query(ctx, listActiveWorkflowRunsForAdmin, arg.RepoID, arg.LimitCount) if err != nil { return nil, err } defer rows.Close() items := []WorkflowRun{} for rows.Next() { var i WorkflowRun if err := rows.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil } const listBlockingConcurrencyRunsForUpdate = `-- name: ListBlockingConcurrencyRunsForUpdate :many SELECT r.id, r.repo_id, r.run_index, r.workflow_file, r.workflow_name, r.head_sha, r.head_ref, r.event, r.event_payload, r.actor_user_id, r.parent_run_id, r.concurrency_group, r.status, r.conclusion, r.pinned, r.need_approval, r.approved_by_user_id, r.started_at, r.completed_at, r.version, r.created_at, r.updated_at, r.trigger_event_id FROM workflow_runs r JOIN workflow_runs current_run ON current_run.id = $1::bigint WHERE r.repo_id = $2::bigint AND r.concurrency_group = $3::text AND r.concurrency_group <> '' AND r.id <> current_run.id AND r.status IN ('queued', 'running') AND (r.created_at, r.id) < (current_run.created_at, current_run.id) AND EXISTS ( SELECT 1 FROM workflow_jobs j WHERE j.run_id = r.id AND j.status IN ('queued', 'running') AND j.cancel_requested = false ) ORDER BY r.created_at ASC, r.id ASC FOR UPDATE OF r ` type ListBlockingConcurrencyRunsForUpdateParams struct { RunID int64 RepoID int64 ConcurrencyGroup string } // Older queued/running runs with the same group block the new run while they // still have at least one queued/running job that has not already received a // cancel request. cancel-in-progress releases the slot by flipping that job // flag even if the runner is still draining the old container. func (q *Queries) ListBlockingConcurrencyRunsForUpdate(ctx context.Context, db DBTX, arg ListBlockingConcurrencyRunsForUpdateParams) ([]WorkflowRun, error) { rows, err := db.Query(ctx, listBlockingConcurrencyRunsForUpdate, arg.RunID, arg.RepoID, arg.ConcurrencyGroup) if err != nil { return nil, err } defer rows.Close() items := []WorkflowRun{} for rows.Next() { var i WorkflowRun if err := rows.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil } const listWorkflowRunWorkflowsForRepo = `-- name: ListWorkflowRunWorkflowsForRepo :many WITH ranked AS ( SELECT workflow_file, workflow_name, (COUNT(*) OVER (PARTITION BY workflow_file))::bigint AS run_count, ROW_NUMBER() OVER (PARTITION BY workflow_file ORDER BY created_at DESC, id DESC) AS rn FROM workflow_runs WHERE repo_id = $1 ) SELECT workflow_file, COALESCE(NULLIF(workflow_name, ''), workflow_file) AS workflow_name, run_count FROM ranked WHERE rn = 1 ORDER BY lower(COALESCE(NULLIF(workflow_name, ''), workflow_file)), workflow_file ` type ListWorkflowRunWorkflowsForRepoRow struct { WorkflowFile string WorkflowName string RunCount int64 } func (q *Queries) ListWorkflowRunWorkflowsForRepo(ctx context.Context, db DBTX, repoID int64) ([]ListWorkflowRunWorkflowsForRepoRow, error) { rows, err := db.Query(ctx, listWorkflowRunWorkflowsForRepo, repoID) if err != nil { return nil, err } defer rows.Close() items := []ListWorkflowRunWorkflowsForRepoRow{} for rows.Next() { var i ListWorkflowRunWorkflowsForRepoRow if err := rows.Scan(&i.WorkflowFile, &i.WorkflowName, &i.RunCount); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil } const listWorkflowRunsForRepo = `-- name: ListWorkflowRunsForRepo :many SELECT r.id, r.repo_id, r.run_index, r.workflow_file, r.workflow_name, r.head_sha, r.head_ref, r.event, r.status, r.conclusion, r.actor_user_id, COALESCE(u.username::text, '')::text AS actor_username, r.started_at, r.completed_at, r.created_at, r.updated_at FROM workflow_runs r LEFT JOIN users u ON u.id = r.actor_user_id WHERE r.repo_id = $1::bigint AND ($2::text IS NULL OR r.workflow_file = $2::text) AND ($3::text IS NULL OR r.head_ref = $3::text) AND ($4::workflow_run_event IS NULL OR r.event = $4::workflow_run_event) AND ($5::workflow_run_status IS NULL OR r.status = $5::workflow_run_status) AND ($6::check_conclusion IS NULL OR r.conclusion = $6::check_conclusion) AND ($7::text IS NULL OR u.username = $7::citext) ORDER BY r.created_at DESC, r.id DESC LIMIT $9 OFFSET $8 ` type ListWorkflowRunsForRepoParams struct { RepoID int64 WorkflowFile pgtype.Text HeadRef pgtype.Text Event NullWorkflowRunEvent Status NullWorkflowRunStatus Conclusion NullCheckConclusion ActorUsername pgtype.Text PageOffset int32 PageLimit int32 } type ListWorkflowRunsForRepoRow struct { ID int64 RepoID int64 RunIndex int64 WorkflowFile string WorkflowName string HeadSha string HeadRef string Event WorkflowRunEvent Status WorkflowRunStatus Conclusion NullCheckConclusion ActorUserID pgtype.Int8 ActorUsername string StartedAt pgtype.Timestamptz CompletedAt pgtype.Timestamptz CreatedAt pgtype.Timestamptz UpdatedAt pgtype.Timestamptz } func (q *Queries) ListWorkflowRunsForRepo(ctx context.Context, db DBTX, arg ListWorkflowRunsForRepoParams) ([]ListWorkflowRunsForRepoRow, error) { rows, err := db.Query(ctx, listWorkflowRunsForRepo, arg.RepoID, arg.WorkflowFile, arg.HeadRef, arg.Event, arg.Status, arg.Conclusion, arg.ActorUsername, arg.PageOffset, arg.PageLimit, ) if err != nil { return nil, err } defer rows.Close() items := []ListWorkflowRunsForRepoRow{} for rows.Next() { var i ListWorkflowRunsForRepoRow if err := rows.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.Status, &i.Conclusion, &i.ActorUserID, &i.ActorUsername, &i.StartedAt, &i.CompletedAt, &i.CreatedAt, &i.UpdatedAt, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil } const lookupWorkflowRunByTriggerEvent = `-- name: LookupWorkflowRunByTriggerEvent :one SELECT id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id FROM workflow_runs WHERE repo_id = $1 AND workflow_file = $2 AND trigger_event_id = $3 ` type LookupWorkflowRunByTriggerEventParams struct { RepoID int64 WorkflowFile string TriggerEventID string } // Companion to EnqueueWorkflowRun for the conflict path: when an // INSERT ... ON CONFLICT DO NOTHING returns no rows, the trigger // handler uses this to find the existing row so it can surface a // stable RunID. Matches the partial-unique index from migration 0051. func (q *Queries) LookupWorkflowRunByTriggerEvent(ctx context.Context, db DBTX, arg LookupWorkflowRunByTriggerEventParams) (WorkflowRun, error) { row := db.QueryRow(ctx, lookupWorkflowRunByTriggerEvent, arg.RepoID, arg.WorkflowFile, arg.TriggerEventID) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err } const markWorkflowRunRunning = `-- name: MarkWorkflowRunRunning :exec UPDATE workflow_runs SET status = 'running', started_at = COALESCE(started_at, now()), version = version + 1, updated_at = now() WHERE id = $1 AND status = 'queued' ` func (q *Queries) MarkWorkflowRunRunning(ctx context.Context, db DBTX, id int64) error { _, err := db.Exec(ctx, markWorkflowRunRunning, id) return err } const nextRunIndexForRepo = `-- name: NextRunIndexForRepo :one SELECT (COALESCE(MAX(run_index), 0) + 1)::bigint AS next_index FROM workflow_runs WHERE repo_id = $1 ` // Atomic next-index emitter: take the max + 1 for this repo. Pairs // with the (repo_id, run_index) UNIQUE so concurrent inserts that // race here will catch a unique-violation and the caller retries. // Cast to bigint so sqlc generates int64 (the column type) rather // than int32 (the type the +1 literal would default to). func (q *Queries) NextRunIndexForRepo(ctx context.Context, db DBTX, repoID int64) (int64, error) { row := db.QueryRow(ctx, nextRunIndexForRepo, repoID) var next_index int64 err := row.Scan(&next_index) return next_index, err } const startWorkflowRun = `-- name: StartWorkflowRun :one UPDATE workflow_runs SET status = 'running', started_at = COALESCE(started_at, now()), version = version + 1, updated_at = now() WHERE id = $1 AND status = 'queued' RETURNING id, repo_id, run_index, workflow_file, workflow_name, head_sha, head_ref, event, event_payload, actor_user_id, parent_run_id, concurrency_group, status, conclusion, pinned, need_approval, approved_by_user_id, started_at, completed_at, version, created_at, updated_at, trigger_event_id ` func (q *Queries) StartWorkflowRun(ctx context.Context, db DBTX, id int64) (WorkflowRun, error) { row := db.QueryRow(ctx, startWorkflowRun, id) var i WorkflowRun err := row.Scan( &i.ID, &i.RepoID, &i.RunIndex, &i.WorkflowFile, &i.WorkflowName, &i.HeadSha, &i.HeadRef, &i.Event, &i.EventPayload, &i.ActorUserID, &i.ParentRunID, &i.ConcurrencyGroup, &i.Status, &i.Conclusion, &i.Pinned, &i.NeedApproval, &i.ApprovedByUserID, &i.StartedAt, &i.CompletedAt, &i.Version, &i.CreatedAt, &i.UpdatedAt, &i.TriggerEventID, ) return i, err }