relq 1.0.124 → 1.0.125

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.
@@ -71,9 +71,11 @@ class PgBase extends relq_base_1.RelqBase {
71
71
  poolErrorHandler;
72
72
  poolConnectHandler;
73
73
  poolRemoveHandler;
74
+ isEdgeRuntime;
74
75
  constructor(schema, config) {
75
76
  super(schema, config);
76
77
  this.environment = (0, environment_detection_1.detectEnvironment)();
78
+ this.isEdgeRuntime = this.environment.type === 'edge';
77
79
  this.usePooling = this.determinePoolingStrategy(config);
78
80
  this.validateConfiguration();
79
81
  this.logEnvironmentInfo();
@@ -135,7 +137,7 @@ class PgBase extends relq_base_1.RelqBase {
135
137
  return await client.query(sql);
136
138
  }
137
139
  finally {
138
- client.release();
140
+ client.release(this.isEdgeRuntime);
139
141
  }
140
142
  }
141
143
  else if (this.client) {
@@ -34,9 +34,11 @@ export class PgBase extends RelqBase {
34
34
  poolErrorHandler;
35
35
  poolConnectHandler;
36
36
  poolRemoveHandler;
37
+ isEdgeRuntime;
37
38
  constructor(schema, config) {
38
39
  super(schema, config);
39
40
  this.environment = detectEnvironment();
41
+ this.isEdgeRuntime = this.environment.type === 'edge';
40
42
  this.usePooling = this.determinePoolingStrategy(config);
41
43
  this.validateConfiguration();
42
44
  this.logEnvironmentInfo();
@@ -98,7 +100,7 @@ export class PgBase extends RelqBase {
98
100
  return await client.query(sql);
99
101
  }
100
102
  finally {
101
- client.release();
103
+ client.release(this.isEdgeRuntime);
102
104
  }
103
105
  }
104
106
  else if (this.client) {
package/dist/index.d.ts CHANGED
@@ -5004,6 +5004,8 @@ declare abstract class PgBase<TSchema = any> extends RelqBase<TSchema> {
5004
5004
  protected poolErrorHandler?: (err: Error) => void;
5005
5005
  protected poolConnectHandler?: () => void;
5006
5006
  protected poolRemoveHandler?: () => void;
5007
+ /** Whether we're running in an edge runtime (Cloudflare Workers, etc.) */
5008
+ protected readonly isEdgeRuntime: boolean;
5007
5009
  constructor(schema: TSchema, config: RelqConfig);
5008
5010
  protected _initialize(): Promise<void>;
5009
5011
  protected _query(sql: string): Promise<DriverQueryResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.124",
3
+ "version": "1.0.125",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",