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
Angelelz
Angelelz11mo ago
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
francis
francisOP11mo ago
the result of the update is [] aha, it's a postgres.RowList which has a .count in addition to .length thank you!
Want results from more Discord servers?
Add your server