onConflict
if i try onConflictDoNothing the plan is to insert a new record into the database. If a record with the same userId and provider already exists, and the apiKey of the existing record is not equal to the apiKey of the new record, the insert operation is skipped and no error is thrown.
i get a a 500 error code and it reads
i am pretty certain this is because i cannot use a where clause in the DoNothing option.
so i try the onConflictDoUpdate option to insert a new record in the database. If a record with the same userId and provider already exists, and the apiKey of the existing record is not equal to the apiKey of the new record, the existing record is updated with the new apiKey. If they are equal, the insert operation is skipped and no error is thrown.
and the error i get for this is
so i feel like i am close but i am clearly missing something.
1 Reply
I figured it out