We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43f2c27 commit 8d7ace8Copy full SHA for 8d7ace8
packages/pg/lib/index.js
@@ -36,14 +36,17 @@ const PG = function (clientConstructor) {
36
37
let clientConstructor = Client
38
39
+let forceNative = false
40
try {
- if (process.env.NODE_PG_FORCE_NATIVE) {
41
- clientConstructor = require('./native')
42
- }
+ forceNative = !!process.env.NODE_PG_FORCE_NATIVE
43
} catch {
44
// ignore, e.g., Deno without --allow-env
45
}
46
+if (forceNative) {
47
+ clientConstructor = require('./native')
48
+}
49
+
50
module.exports = new PG(clientConstructor)
51
52
// lazy require native module...the native module may not have installed
0 commit comments