-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
force usage of pg.native via environment variable #381
Conversation
I think this is slightly hackish, but I can understand the use-case. The only thing missing is some sort of test. Maybe something like this: process.env.NODE_PG_FORCE_NATIVE = true;
var pg = require('../../lib/pg');
//figure out some how this is the native binding
assert(pg instanceof require('../../lib/native/index)); That's psuedocode, but close to what the test should be I think. Each test file runs in its own process so you wont affect 'global state' by modifying the environment variable there since the process is only alive while the test file runs. Just add the test under |
Ok. I just fixed another bug (for 0.8.x). I'll add a testcase for my changes ... |
OK? |
Sorry for the delay. I am at nodeconf and have been busy plus there is limited internet. I will merge this by end of weekend. |
perfect. 👍 |
force usage of pg.native via environment variable
I want to force the usage of the native client without changing any code. This is especially useful when using modules which use
node-postgresql
.With this patch
node-postgres
uses the native client when the environment variableNODE_PG_FORCE_NATIVE
is set.