aosdev's avatar

upsert() failed records

Hello, I have a table with name with product_campaigns (example). This table has "campaign_id", "product_id" FK columns and "price" column.

I'm using job batches to upsert data to this table, sometimes i'm upserting 50k records with chunk. But i need to show a report for failed records to customers like "failed at product id 15 and 17...". Anyone know a way to detect failed rows while upserting?

Kind regards.

0 likes
2 replies
SilenceBringer's avatar

@aosdev as far as I know, there are no ways to know which records was failed using bulk operations. Mass upsert will will return just general result - all was successful or SOMETHING was wrong

1 like

Please or to participate in this conversation.