Skip to content

Conversation

@loay
Copy link
Contributor

@loay loay commented Jan 19, 2017

connect to #204

@loay
Copy link
Contributor Author

loay commented Jan 20, 2017

@bajtos PTAL. Thanks

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Could you please add a unit-test to verify this change. Perhaps these tests should be implemented in the shared test suite in loopback-datasource-juggler?

case 'DELETE':
case 'UPDATE':
result = {count: data.rowCount};
result = {affectedRows: data.rowCount};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please preserve the count property for backwards compatibility.

result = {affectedRows: data.rowCount, count: data.rowCount};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and unit test added

@bajtos
Copy link
Member

bajtos commented Jan 20, 2017

Let's leave the tests out of scope of this patch, since they have to be implemented in a different repository anyways. However, I think it makes sense to add a postgresql-specific test to verify that the count property is preserved.

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two details to fix, the rest LGTM. Please squash the comments before landing.

});
});

it('should reserve property `count` after query execution', function(done) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preserve

Post.create(
{title: 'T10', content: 'C10'},
function(err, p) {
should.not.exists(err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (err) return done(err);

@loay loay merged commit 9b49fc9 into master Jan 24, 2017
@loay loay removed the review label Jan 24, 2017
@loay loay deleted the affectedRows branch January 24, 2017 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants