Skip to content

Bring native API in line with pure js version. Fixes #743 #937

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

Merged
merged 2 commits into from
Feb 15, 2016

Conversation

coagmano
Copy link
Contributor

node-postgres abstracts over the pg-native module to provide exactly the same interface as the pure JavaScript version. No other code changes are required. If you find yourself having to change code other than the require statement when switching from require('pg') to require('pg').native please report an issue.

In issue #743 the code breaks using pg-native where the Result.addRow method is used.

This method is missing from the native bindings because libpq loads all rows into memory before handing it to pg-native. The native bindings already simulate emitting row events, but does not replicate the addRow function.

I've added a test in test/integration/client/simple-query-tests.js using Result.addRow.

And an empty function stub in lib/native/result.js which doesn't have to do anything since pg-native accumulates rows by default.

@brianc
Copy link
Owner

brianc commented Feb 15, 2016

Hey this is a great find & fix! Thank you!! Merging now. :)

brianc added a commit that referenced this pull request Feb 15, 2016
Bring native API in line with pure js version. Fixes #743
@brianc brianc merged commit f26cb73 into brianc:master Feb 15, 2016
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 this pull request may close these issues.

2 participants