node-pg-query icon indicating copy to clipboard operation
node-pg-query copied to clipboard

Native bindings

Open lukehorvat opened this issue 11 years ago • 3 comments

According to the node-postgres docs, you can use native bindings by doing require('pg').native. Would be nice if node-pg-query allowed for that somehow.

lukehorvat avatar Dec 10 '14 04:12 lukehorvat

Fantastic idea. Any idea of an API? I have one in mind. Should be an easy enhancement.

On Tuesday, December 9, 2014, Luke Horvat [email protected] wrote:

According to the node-postgres docs https://github.com/brianc/node-postgres#native-bindings, you can use native bindings by doing require('pg').native. Would be nice if node-pg-query allowed for that somehow.

— Reply to this email directly or view it on GitHub https://github.com/brianc/node-pg-query/issues/8.

brianc avatar Dec 10 '14 21:12 brianc

Off the top of my head, there are a few ways:

  1. Make it a settable property, in a similar vein to connectionParameters.
  2. Add another parameter to the exported query function e.g. function(text, values, isNative, cb).
  3. Remove this block and have the developer pass in the peer dependency themselves.

I don't really have a preference. What did you have in mind?

lukehorvat avatar Dec 11 '14 01:12 lukehorvat

+1 for native bindings

sbefort avatar Apr 25 '16 02:04 sbefort