relq 1.0.123 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,8 @@ function toPoolConfig(config) {
16
16
  const port = config.aws?.port ?? config.port ?? 5432;
17
17
  const user = config.aws?.user ?? config.user ?? (isAws ? 'admin' : undefined);
18
18
  const ssl = isAws ? (config.aws.ssl ?? true) : config.ssl;
19
+ const isWorkers = typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers';
20
+ const allowExitOnIdle = !isWorkers;
19
21
  const poolConfig = {
20
22
  host,
21
23
  port,
@@ -28,7 +30,7 @@ function toPoolConfig(config) {
28
30
  connectionTimeoutMillis: config.pool?.connectionTimeoutMillis ?? smartDefaults.connectionTimeoutMillis,
29
31
  application_name: config.pool?.application_name,
30
32
  ssl: config.pool?.ssl ?? ssl,
31
- allowExitOnIdle: true
33
+ allowExitOnIdle
32
34
  };
33
35
  if (config.connectionString) {
34
36
  return {
@@ -39,7 +41,7 @@ function toPoolConfig(config) {
39
41
  connectionTimeoutMillis: poolConfig.connectionTimeoutMillis,
40
42
  application_name: poolConfig.application_name,
41
43
  ssl: poolConfig.ssl,
42
- allowExitOnIdle: true
44
+ allowExitOnIdle
43
45
  };
44
46
  }
45
47
  return poolConfig;
@@ -11,6 +11,8 @@ export function toPoolConfig(config) {
11
11
  const port = config.aws?.port ?? config.port ?? 5432;
12
12
  const user = config.aws?.user ?? config.user ?? (isAws ? 'admin' : undefined);
13
13
  const ssl = isAws ? (config.aws.ssl ?? true) : config.ssl;
14
+ const isWorkers = typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers';
15
+ const allowExitOnIdle = !isWorkers;
14
16
  const poolConfig = {
15
17
  host,
16
18
  port,
@@ -23,7 +25,7 @@ export function toPoolConfig(config) {
23
25
  connectionTimeoutMillis: config.pool?.connectionTimeoutMillis ?? smartDefaults.connectionTimeoutMillis,
24
26
  application_name: config.pool?.application_name,
25
27
  ssl: config.pool?.ssl ?? ssl,
26
- allowExitOnIdle: true
28
+ allowExitOnIdle
27
29
  };
28
30
  if (config.connectionString) {
29
31
  return {
@@ -34,7 +36,7 @@ export function toPoolConfig(config) {
34
36
  connectionTimeoutMillis: poolConfig.connectionTimeoutMillis,
35
37
  application_name: poolConfig.application_name,
36
38
  ssl: poolConfig.ssl,
37
- allowExitOnIdle: true
39
+ allowExitOnIdle
38
40
  };
39
41
  }
40
42
  return poolConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.123",
3
+ "version": "1.0.124",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",