diff --git a/client.go b/client.go index 919014fe..5529061a 100644 --- a/client.go +++ b/client.go @@ -1066,7 +1066,9 @@ func (c *Client[TTx]) InsertTx(ctx context.Context, tx TTx, args JobArgs, opts * return nil, err } - return dbsqlc.JobRowFromInternal(res.Job), nil + jobRow := dbsqlc.JobRowFromInternal(res.Job) + jobRow.UniqueSkippedAsDuplicate = res.UniqueSkippedAsDuplicate + return jobRow, nil } // InsertManyParams encapsulates a single job combined with insert options for diff --git a/rivertype/job_row.go b/rivertype/job_row.go index f3aac8b0..562a63d0 100644 --- a/rivertype/job_row.go +++ b/rivertype/job_row.go @@ -94,6 +94,11 @@ type JobRow struct { // functional behavior and are meant entirely as a user-specified construct // to help group and categorize jobs. Tags []string + + // UniqueSkippedAsDuplicate indicates that the insert didn't occur because + // it was a unique job, and another unique job within the unique parameters + // was already in the database. + UniqueSkippedAsDuplicate bool } // JobState is the state of a job. Jobs start as `available` or `scheduled`, and