Is there a way to get the update count resulting from a query without returning?
I would like to assert that a statement in a transaction updates only the number of rows I expect, and fail if that number is different. I can do it with
result.length
and returning()
but that includes a ton of data I don't need.2 Replies
That depends on the driver
Each driver will put the updatedCount in a differente place. but the types should help you
Or just console log the result of the update without returning
the result of the update is
[]
aha, it's a postgres.RowList
which has a .count
in addition to .length
thank you!