Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for UpdateResult #988

Closed
mjomble opened this issue May 14, 2024 · 1 comment · Fixed by #993
Closed

Documentation for UpdateResult #988

mjomble opened this issue May 14, 2024 · 1 comment · Fixed by #993

Comments

@mjomble
Copy link

mjomble commented May 14, 2024

InsertResult is very well documented, with the nuances of different dialects clearly described 👍

UpdateResult, however, contains only two similarly named fields (numUpdatedRows and numChangedRows) with zero comments, which can lead to some confusion 😄

It would be nice to have similarly detailed comments in both. Unfortunately, I don't have enough information to properly document this myself in a PR. I found some info in this issue, but I suspect there's more to it.

Maybe @wirekang, @igalklebanov or @koskimas would be up for it? Or you could post the necessary information in this thread, which I could then prepare into a PR.

@wirekang
Copy link
Contributor

Comments on QueryResult will be enough information to make a PR. Good luck.

/**
* This is defined for insert, update, delete and merge queries and contains
* the number of rows the query inserted/updated/deleted.
*/
readonly numAffectedRows?: bigint
/**
* This is defined for update queries and contains the number of rows
* the query changed.
* This is optional and only provided by some drivers like node-mysql2.
*/
readonly numChangedRows?: bigint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants