You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following code testing an INSERT. The goal is to simulate a key already exists; which, when specified with 'ON CONFLICT DO NOTHING' returns no error and instead just RowsAffected() on the result returns 0.
GlobalMock := mocket.Catcher.Reset()
GlobalMock.Logging = true
expectedReservation := GetReservation()
GlobalMock.NewMock().WithQuery(
`INSERT INTO "reservations" ("created_at","updated_at","deleted_at","dataset_project","dataset_name","dataset_domain","dataset_version","tag_name","owner_id","expires_at","serialized_metadata") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) ON CONFLICT DO NOTHING`,
).WithRowsNum(0)
What I am seeing is that no matter what I change the WithRowsNum() called value to the RowsAffected always returns 1. This same syntax works well in testing an UPDATE command, so it's peculiar that it is not working here. Any thoughts?
The text was updated successfully, but these errors were encountered:
I have the following code testing an INSERT. The goal is to simulate a key already exists; which, when specified with 'ON CONFLICT DO NOTHING' returns no error and instead just RowsAffected() on the result returns 0.
What I am seeing is that no matter what I change the WithRowsNum() called value to the RowsAffected always returns 1. This same syntax works well in testing an UPDATE command, so it's peculiar that it is not working here. Any thoughts?
The text was updated successfully, but these errors were encountered: