-
Notifications
You must be signed in to change notification settings - Fork 217
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
rowCount unavailable after UPDATE / INSERT / DELETE #17
Comments
MyBatis solves this by having methods like My original solution provides you access to full result object, which allows future users to get any possible future properties available there :) Also might allow easier transition from pure pg/other libraries to this one. Therefore, I would still include it. |
I'd like to see that no other fix is possible in the meantime, before opting for a breaking change. I'll try to come up with some ideas.... |
My PR wasn't breaking, it just added new queryResult. But having |
Method Something like |
You know, I think I have a better idea... How about, we add method called something like The more I think about it, the more I like it, except perhaps for the method name :) Thinking of a better name, please throw in some of your own ;)
Right now I think the one that best fits the architecture logic is |
Well, if you execute something like this:
I just tested it, and I got both. Although now the row.length is the same as rowCount, so probably not so important... I'm just not quite sure... |
Well, that still produces rows array, therefore you have its length property. |
Very good. I'm adding support for |
I have implemented, tested, and checked in the changes. You can get them from the current index.js in the master branch. New method There will be some documentation, and perhaps extra tests added before I release it as 1.0.3 (it's not a breaking change). |
Thats great news, thanks! |
Version 1.0.3 has been released. There were some changes in the source after all, to fix an issue found after adding a few good tests, which is always nice. I will be adding an example to the Learn by Example tutorial shortly, but in the meantime the issue is closed. Thank you for your help! 👍 |
Raw Result example has been added to the Learn by Example tutorial ;) |
@mdvorak, Unrelated to this, but if you liked this library, I really appreciate if you can give me a feedback on this small addition: pg-monitor |
@mdvorak reflecting on some of the passed changes, added method |
https://github.com/vitaly-t/pg-promise/wiki/Learn-by-Example#affected-rows |
Where is this link declared? On 10 December 2015 at 16:13, Mikhail Osher notifications@github.com
|
@miraage The link has been updated: Raw Result Cheers! |
Created on behalf of @mdvorak, after his merge request.
Method
query
provides no access torowCount
after successful execution ofINSERT
/UPDATE
/DELETE
.The text was updated successfully, but these errors were encountered: