Added NODE_PG_FORCE_NATIVE to force usage of libpg bindings (native client)
This commit is contained in:
parent
690f224c11
commit
c126ba1c7c
19
lib/index.js
19
lib/index.js
@ -52,12 +52,15 @@ PG.prototype.cancel = function(config, client, query) {
|
||||
cancellingClient.cancel(client, query);
|
||||
};
|
||||
|
||||
module.exports = new PG(Client);
|
||||
|
||||
//lazy require native module...the native module may not have installed
|
||||
module.exports.__defineGetter__("native", function() {
|
||||
delete module.exports.native;
|
||||
module.exports.native = new PG(require(__dirname + '/native'));
|
||||
return module.exports.native;
|
||||
});
|
||||
if (process.env.hasOwnProperty('NODE_PG_FORCE_NATIVE')) {
|
||||
module.exports = new PG(require(__dirname + '/native'));
|
||||
} else {
|
||||
module.exports = new PG(Client);
|
||||
|
||||
//lazy require native module...the native module may not have installed
|
||||
module.exports.__defineGetter__("native", function() {
|
||||
delete module.exports.native;
|
||||
module.exports.native = new PG(require(__dirname + '/native'));
|
||||
return module.exports.native;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user