@prisma/orm-target-postgres 8.0.0-rc.24-dev.1 → 8.0.0-rc.24
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.
- package/dist/{adapter-dMZYwONo.d.mts → adapter-DXebVrOK.d.mts} +10 -10
- package/dist/{adapter-dMZYwONo.d.mts.map → adapter-DXebVrOK.d.mts.map} +1 -1
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/{aggregates-0EfVySBb.d.mts → aggregates-CJGvlOCM.d.mts} +10 -10
- package/dist/{aggregates-0EfVySBb.d.mts.map → aggregates-CJGvlOCM.d.mts.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{pack-DnAO8TDj.d.mts → pack-DgJcT8hM.d.mts} +2 -2
- package/dist/{pack-DnAO8TDj.d.mts.map → pack-DgJcT8hM.d.mts.map} +1 -1
- package/dist/{prisma7-binding-BskIu_uu.d.mts → prisma7-binding-B0Toqx_S.d.mts} +2 -2
- package/dist/{prisma7-binding-BskIu_uu.d.mts.map → prisma7-binding-B0Toqx_S.d.mts.map} +1 -1
- package/dist/{runtime-DuP4WGEr.mjs → runtime-Cnam1N0o.mjs} +44 -1
- package/dist/runtime-Cnam1N0o.mjs.map +1 -0
- package/dist/target.d.mts +3 -3
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/package.json +10 -10
- package/dist/runtime-DuP4WGEr.mjs.map +0 -1
|
@@ -116,7 +116,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
116
116
|
readonly operation: "sum";
|
|
117
117
|
readonly input: {
|
|
118
118
|
readonly kind: "codec";
|
|
119
|
-
readonly codecId: "pg/
|
|
119
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
120
120
|
};
|
|
121
121
|
readonly output: {
|
|
122
122
|
readonly kind: "codec";
|
|
@@ -128,7 +128,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
128
128
|
readonly operation: "sumBigInt";
|
|
129
129
|
readonly input: {
|
|
130
130
|
readonly kind: "codec";
|
|
131
|
-
readonly codecId: "pg/
|
|
131
|
+
readonly codecId: "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
132
132
|
};
|
|
133
133
|
readonly output: {
|
|
134
134
|
readonly kind: "codec";
|
|
@@ -140,7 +140,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
140
140
|
readonly operation: "sumBigInt";
|
|
141
141
|
readonly input: {
|
|
142
142
|
readonly kind: "codec";
|
|
143
|
-
readonly codecId: "pg/
|
|
143
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1";
|
|
144
144
|
};
|
|
145
145
|
readonly output: {
|
|
146
146
|
readonly kind: "codec";
|
|
@@ -174,7 +174,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
174
174
|
readonly operation: "sum";
|
|
175
175
|
readonly input: {
|
|
176
176
|
readonly kind: "codec";
|
|
177
|
-
readonly codecId: "pg/
|
|
177
|
+
readonly codecId: "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
178
178
|
};
|
|
179
179
|
readonly output: {
|
|
180
180
|
readonly kind: "codec";
|
|
@@ -263,7 +263,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
263
263
|
readonly operation: "avg";
|
|
264
264
|
readonly input: {
|
|
265
265
|
readonly kind: "codec";
|
|
266
|
-
readonly codecId: "pg/
|
|
266
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1";
|
|
267
267
|
};
|
|
268
268
|
readonly output: {
|
|
269
269
|
readonly kind: "codec";
|
|
@@ -275,7 +275,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
275
275
|
readonly operation: "avgDecimal";
|
|
276
276
|
readonly input: {
|
|
277
277
|
readonly kind: "codec";
|
|
278
|
-
readonly codecId: "pg/
|
|
278
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1" | "pg/numeric@1";
|
|
279
279
|
};
|
|
280
280
|
readonly output: {
|
|
281
281
|
readonly kind: "codec";
|
|
@@ -286,7 +286,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
286
286
|
readonly operation: "avg";
|
|
287
287
|
readonly input: {
|
|
288
288
|
readonly kind: "codec";
|
|
289
|
-
readonly codecId: "pg/
|
|
289
|
+
readonly codecId: "pg/float4@1" | "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
290
290
|
};
|
|
291
291
|
readonly output: {
|
|
292
292
|
readonly kind: "codec";
|
|
@@ -383,7 +383,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
383
383
|
readonly operation: "min";
|
|
384
384
|
readonly input: {
|
|
385
385
|
readonly kind: "codec";
|
|
386
|
-
readonly codecId: "pg/
|
|
386
|
+
readonly codecId: "pg/money@1" | "pg/interval@1" | "pg/interval-string@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/oid@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/timestamp-date@1" | "pg/timestamp-instant@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
387
387
|
};
|
|
388
388
|
readonly output: {
|
|
389
389
|
readonly kind: "self";
|
|
@@ -424,7 +424,7 @@ declare const postgresAdapterContractContributions: {
|
|
|
424
424
|
readonly operation: "max";
|
|
425
425
|
readonly input: {
|
|
426
426
|
readonly kind: "codec";
|
|
427
|
-
readonly codecId: "pg/
|
|
427
|
+
readonly codecId: "pg/money@1" | "pg/interval@1" | "pg/interval-string@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/oid@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/timestamp-date@1" | "pg/timestamp-instant@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
428
428
|
};
|
|
429
429
|
readonly output: {
|
|
430
430
|
readonly kind: "self";
|
|
@@ -435,4 +435,4 @@ declare const postgresAdapterContractContributions: {
|
|
|
435
435
|
};
|
|
436
436
|
//#endregion
|
|
437
437
|
export { postgresRawCodecInferer as i, postgresAdapterCapabilities as n, postgresAdapterContractContributions as r, createPostgresAdapter as t };
|
|
438
|
-
//# sourceMappingURL=adapter-
|
|
438
|
+
//# sourceMappingURL=adapter-DXebVrOK.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-
|
|
1
|
+
{"version":3,"file":"adapter-DXebVrOK.d.mts","names":[],"sources":["../../../../3-targets/postgres/2-adapter/dist/adapter.d.mts"],"mappings":";;;;;;;;;;cAOc,+BAA+B,QAAQ,aAAa,kBAAkB;WACzE;WACA;WACA,SAAS;mBACD;mBACA;EACjB,YAAY,eAAe,uBAAuB,gBAAgB,gBAAgB,4BAA4B,YAAY;EAC1H,MAAM,KAAK,cAAc,iBAAiB,SAAS,eAAe,oBAAoB;;;;;;;cAO1E,yBAAyB;iBACtB,sBAAsB,UAAU,yBAAyB,SAAS;;;cAGrE,6BAA6B;WAChC;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;;WAEF;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;;;;;;;;cAQC;WACH,cAAc;aACZ;eACE;eACA;eACA;eACA;eACA;eACA;eACA;eACA;;aAEF;eACE;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;eACA;;;WAGJ;aACE;eACE;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;;eAEA;eACA;iBACE;;eAEF;iBACE;iBACA;;eAEF;eACA;eACA,6EAA6E;;eAE7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,6EAA6E;eAC7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,6EAA6E;eAC7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,6EAA6E;eAC7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,6EAA6E;eAC7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA,6EAA6E;eAC7E;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;iBACA;;eAEF;;eAEA;eACA;iBACE;iBACA;;eAEF;iBACE;;eAEF"}
|
package/dist/adapter.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-CJvUnBU9-Bvn7zbr1.mjs";
|
|
2
2
|
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-D6lgKhE5-DEwv-pSi.mjs";
|
|
3
3
|
import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, t as PostgresCodecRegistry } from "./codecs-BZ74mlUI.mjs";
|
|
4
|
-
import { i as postgresRawCodecInferer, n as postgresAdapterCapabilities, r as postgresAdapterContractContributions, t as createPostgresAdapter } from "./adapter-
|
|
4
|
+
import { i as postgresRawCodecInferer, n as postgresAdapterCapabilities, r as postgresAdapterContractContributions, t as createPostgresAdapter } from "./adapter-DXebVrOK.mjs";
|
|
5
5
|
import { A as varcharColumn, C as timestampStringColumn, D as timestamptzTemporalColumn, E as timestamptzStringColumn, O as timetzColumn, S as timestampJsDateColumn, T as timestamptzJsDateColumn, _ as rawColumn, a as dateStringColumn, b as timeTemporalColumn, c as float8Column, d as int8BigIntColumn, f as intervalPartsColumn, g as numericStringColumn, h as jsonbColumn, i as charColumn, k as varbitColumn, l as int2Column, m as jsonColumn, n as boolColumn, o as dateTemporalColumn, p as intervalStringColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as textColumn, w as timestampTemporalColumn, x as timestampInstantColumn, y as timeStringColumn } from "./column-types-DBCLQW1w.mjs";
|
|
6
6
|
import { i as quoteIdentifier, r as qualifyName, t as escapeLiteral } from "./sql-utils-Bq4nuPvy.mjs";
|
|
7
7
|
import { t as PostgresControlAdapter } from "./control-C8M0RWE6.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as postgresRawCodecInferer, n as postgresAdapterCapabilities, r as postgresAdapterContractContributions, t as createPostgresAdapter } from "./adapter-
|
|
1
|
+
import { i as postgresRawCodecInferer, n as postgresAdapterCapabilities, r as postgresAdapterContractContributions, t as createPostgresAdapter } from "./adapter-DXebVrOK.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresAdapterCapabilities, postgresAdapterContractContributions, postgresRawCodecInferer };
|
|
@@ -31,7 +31,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
31
31
|
readonly operation: "sum";
|
|
32
32
|
readonly input: {
|
|
33
33
|
readonly kind: "codec";
|
|
34
|
-
readonly codecId: "pg/
|
|
34
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
35
35
|
};
|
|
36
36
|
readonly output: {
|
|
37
37
|
readonly kind: "codec";
|
|
@@ -43,7 +43,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
43
43
|
readonly operation: "sumBigInt";
|
|
44
44
|
readonly input: {
|
|
45
45
|
readonly kind: "codec";
|
|
46
|
-
readonly codecId: "pg/
|
|
46
|
+
readonly codecId: "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
47
47
|
};
|
|
48
48
|
readonly output: {
|
|
49
49
|
readonly kind: "codec";
|
|
@@ -55,7 +55,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
55
55
|
readonly operation: "sumBigInt";
|
|
56
56
|
readonly input: {
|
|
57
57
|
readonly kind: "codec";
|
|
58
|
-
readonly codecId: "pg/
|
|
58
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1";
|
|
59
59
|
};
|
|
60
60
|
readonly output: {
|
|
61
61
|
readonly kind: "codec";
|
|
@@ -89,7 +89,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
89
89
|
readonly operation: "sum";
|
|
90
90
|
readonly input: {
|
|
91
91
|
readonly kind: "codec";
|
|
92
|
-
readonly codecId: "pg/
|
|
92
|
+
readonly codecId: "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
93
93
|
};
|
|
94
94
|
readonly output: {
|
|
95
95
|
readonly kind: "codec";
|
|
@@ -178,7 +178,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
178
178
|
readonly operation: "avg";
|
|
179
179
|
readonly input: {
|
|
180
180
|
readonly kind: "codec";
|
|
181
|
-
readonly codecId: "pg/
|
|
181
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1";
|
|
182
182
|
};
|
|
183
183
|
readonly output: {
|
|
184
184
|
readonly kind: "codec";
|
|
@@ -190,7 +190,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
190
190
|
readonly operation: "avgDecimal";
|
|
191
191
|
readonly input: {
|
|
192
192
|
readonly kind: "codec";
|
|
193
|
-
readonly codecId: "pg/
|
|
193
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1" | "pg/numeric@1";
|
|
194
194
|
};
|
|
195
195
|
readonly output: {
|
|
196
196
|
readonly kind: "codec";
|
|
@@ -201,7 +201,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
201
201
|
readonly operation: "avg";
|
|
202
202
|
readonly input: {
|
|
203
203
|
readonly kind: "codec";
|
|
204
|
-
readonly codecId: "pg/
|
|
204
|
+
readonly codecId: "pg/float4@1" | "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
205
205
|
};
|
|
206
206
|
readonly output: {
|
|
207
207
|
readonly kind: "codec";
|
|
@@ -298,7 +298,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
298
298
|
readonly operation: "min";
|
|
299
299
|
readonly input: {
|
|
300
300
|
readonly kind: "codec";
|
|
301
|
-
readonly codecId: "pg/
|
|
301
|
+
readonly codecId: "pg/money@1" | "pg/interval@1" | "pg/interval-string@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/oid@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/timestamp-date@1" | "pg/timestamp-instant@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
302
302
|
};
|
|
303
303
|
readonly output: {
|
|
304
304
|
readonly kind: "self";
|
|
@@ -339,7 +339,7 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
339
339
|
readonly operation: "max";
|
|
340
340
|
readonly input: {
|
|
341
341
|
readonly kind: "codec";
|
|
342
|
-
readonly codecId: "pg/
|
|
342
|
+
readonly codecId: "pg/money@1" | "pg/interval@1" | "pg/interval-string@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/oid@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/timestamp-date@1" | "pg/timestamp-instant@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
343
343
|
};
|
|
344
344
|
readonly output: {
|
|
345
345
|
readonly kind: "self";
|
|
@@ -348,4 +348,4 @@ declare const postgresAggregateDescriptors: readonly [{
|
|
|
348
348
|
})[]];
|
|
349
349
|
//#endregion
|
|
350
350
|
export { postgresAggregateDescriptors as t };
|
|
351
|
-
//# sourceMappingURL=aggregates-
|
|
351
|
+
//# sourceMappingURL=aggregates-CJGvlOCM.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregates-
|
|
1
|
+
{"version":3,"file":"aggregates-CJGvlOCM.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/aggregates.d.mts"],"mappings":";;;;;;cAKc;WACH;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;;WAEA;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as createPgPool, r as createPgClient } from "./session-settings-cHekxETj-CKXTmPoK.mjs";
|
|
2
2
|
import { t as PostgresControlDriver } from "./control-B_4_C92P.mjs";
|
|
3
|
-
import { n as suppressIdleConnectionErrors } from "./runtime-
|
|
3
|
+
import { n as suppressIdleConnectionErrors } from "./runtime-Cnam1N0o.mjs";
|
|
4
4
|
export { PostgresControlDriver, createPgClient, createPgPool, suppressIdleConnectionErrors };
|
package/dist/driver__runtime.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as createPgPool, r as createPgClient } from "./session-settings-cHekxETj-CKXTmPoK.mjs";
|
|
2
|
-
import { n as suppressIdleConnectionErrors, t as postgresRuntimeDriverDescriptor } from "./runtime-
|
|
2
|
+
import { n as suppressIdleConnectionErrors, t as postgresRuntimeDriverDescriptor } from "./runtime-Cnam1N0o.mjs";
|
|
3
3
|
export { createPgClient, createPgPool, postgresRuntimeDriverDescriptor as default, suppressIdleConnectionErrors };
|
|
@@ -1169,7 +1169,7 @@ declare const postgresTargetDescriptorMetaBase: {
|
|
|
1169
1169
|
name: string;
|
|
1170
1170
|
tableName: string;
|
|
1171
1171
|
namespaceId: string;
|
|
1172
|
-
operation: "select" | "
|
|
1172
|
+
operation: "select" | "delete" | "insert" | "update" | "all";
|
|
1173
1173
|
roles: readonly string[];
|
|
1174
1174
|
permissive: boolean;
|
|
1175
1175
|
prefix?: string;
|
|
@@ -1462,4 +1462,4 @@ declare const postgresTargetDescriptorMeta: typeof postgresTargetDescriptorMetaB
|
|
|
1462
1462
|
};
|
|
1463
1463
|
//#endregion
|
|
1464
1464
|
export { postgresTargetDescriptorMeta as t };
|
|
1465
|
-
//# sourceMappingURL=pack-
|
|
1465
|
+
//# sourceMappingURL=pack-DgJcT8hM.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack-
|
|
1
|
+
{"version":3,"file":"pack-DgJcT8hM.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/pack.d.mts"],"mappings":";;;;;;;;;;cASc;WACH;WACA;WACA;WACA,yDAAyD,iBAAiB,uBAAuB;aAC/F;OACN;aACM;OACN;aACM;OACN;aACM;OACN;aACM;OACN;aACM;OACN;aACM;MACP;MACA;;;WAGK;aACE;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;;mBAEF;qBACE;;;;eAIN;iBACE;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;qBAGJ;uBACE;uBACA;;;;iBAIN;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;qBAGJ;uBACE;uBACA;;qBAEF;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA;uBACE;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA;uBACE;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA;uBACE;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA;uBACE;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA;uBACE;;;;;eAKR;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;eAMV;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;;;eAGJ;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;;;eAGJ;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;qBAEF;uBACE;uBACA;;;;;eAKR;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;;;eAGJ;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;;;eAGJ;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;mBACE;;iBAEF;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;mBAEA;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;mBAEA;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;mBAEA;qBACE;;mBAEF;;mBAEA;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;qBACA;;mBAEF;mBACA;qBACE;;;mBAGF;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;mBACA;qBACE;;;mBAGF;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;qBACE;qBACA;;mBAEF;;mBAEA;qBACE;qBACA;;mBAEF;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;mBAEA;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;qBAEF;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;iBACA;mBACE;;;eAGJ;iBACE;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;eAKR;iBACE;iBACA;iBACA;iBACA;mBACE;mBACA;mBACA;mBACA;;iBAEF;mBACE;mBACA;qBACE;uBACE;uBACA;;;;;;aAMV,WAAW,SAAS,kEAAkE;aACtF,uEAAuE;aACvE,yBAAyB,SAAS;aAClC;eACE;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;;iBAEO;mBACE,UAAU,OAAO,oBAAoB,wDAAwD,2BAA2B;;;eAG5H;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;;iBAEO;mBACE,UAAU,OAAO,+BAA+B;;;eAGpD;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;iBAEO;UACP,UAAU,OAAO,yBAAyB,wDAAwD,2BAA2B;UAC7H,eAAe,QAAQ;YACrB;;;;eAIG;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;UACA;;iBAEO;UACP,UAAU,sCAAsC,wBAAwB,yBAAyB,wDAAwD,2BAA2B;UACpL,iBAAiB,QAAQ;YACvB;YACA;;;;eAIG;iBACE;iBACA;iBACA,+DAA+D;UACtE;UACA;UACA;;iBAEO;mBACE,UAAU,sCAAsC,4BAA4B;mBAC5E;;;;aAIN;eACE;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;mBACW;mBACA;;QAEX;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;mBACW;mBACA;;QAEX;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;mBACW;mBACA;;QAEX;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;mBACW;mBACA;;QAEX;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;mBACW;mBACA;;QAEX;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;QACA;UACE,0CAA0C;YACxC;4CACgC;;;eAG7B;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;;eAEN;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;;;aAGR;eACE;iBACE;iBACA;iBACA,qCAAqC;iBACrC,QAAQ,SAAS,sBAAsB,wDAAwD;UACtG;UACA,QAAQ;;;eAGH;iBACE;iBACA;iBACA,qCAAqC;iBACrC;iBACA,QAAQ;mBACN,QAAQ;mBACR,WAAW;mBACX;mBACA;mBACA,uCAAuC;WAC/C,wDAAwD;UACzD;YACE;YACA;YACA;cACE;cACA;;YAEF;YACA;YACA;YACA;;;;;aAKC,wBAAwB;aACxB,0BAA0B;aAC1B,+BAA+B;aAC/B,2BAA2B;;WAE7B;aACE;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,qCAAqC,sDAAsD,6CAA6C,8CAA8C;iBACtL;;;aAGJ;;aAEA;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,qCAAqC,0CAA0C;iBAC/E;;;aAGJ;;aAEA;aACA,YAAY,8DAA8D;eACxE;eACA;iBACE;iBACA,qCAAqC,uDAAuD,6CAA6C,+CAA+C;iBACxL;;;aAGJ;yDAC4C,sFAAsF;WACpI;aACE,yBAAyB;aACzB,gFAAgF;;WAElF;aACE;eACE;iBACE;iBACA;iBACA;;;;WAIN;WACA;WACA;WACA;WACA;WACA;WACA,mEAAmE;WACnE;aACE;aACA;;WAEF,eAAe;;cAEZ,qCAAqC;WACxC,eAAe;WACf,wBAAwB;WACxB,6BAA6B;WAC7B;aACE;eACE;eACA"}
|
|
@@ -1206,7 +1206,7 @@ declare const prisma7PostgresBinding: {
|
|
|
1206
1206
|
name: string;
|
|
1207
1207
|
tableName: string;
|
|
1208
1208
|
namespaceId: string;
|
|
1209
|
-
operation: "select" | "
|
|
1209
|
+
operation: "select" | "delete" | "insert" | "update" | "all";
|
|
1210
1210
|
roles: readonly string[];
|
|
1211
1211
|
permissive: boolean;
|
|
1212
1212
|
prefix?: string;
|
|
@@ -1580,4 +1580,4 @@ declare const prisma7PostgresBinding: {
|
|
|
1580
1580
|
};
|
|
1581
1581
|
//#endregion
|
|
1582
1582
|
export { prisma7PostgresBinding as t };
|
|
1583
|
-
//# sourceMappingURL=prisma7-binding-
|
|
1583
|
+
//# sourceMappingURL=prisma7-binding-B0Toqx_S.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma7-binding-
|
|
1
|
+
{"version":3,"file":"prisma7-binding-B0Toqx_S.d.mts","names":[],"sources":["../../../../3-targets/postgres/1-target/dist/prisma7-binding.d.mts"],"mappings":";;;;;;;;;;;;;UAaU;WACC;WACA;;;;;iBAKM,sBAAsB;;iBAEtB,sBAAsB,mBAAmB;;;;;;;;iBAQzC,2BAA2B,gBAAgB;;;iBAG3C,YAAY;;iBAEZ,yBAAyB,QAAQ,WAAW;WAClD;WACA,aAAa,SAAS;;;;;;;;;cASnB;WACH;aACE;aACA;aACA;aACA,yDAAyD,iBAAiB,uBAAuB;eAC/F;SACN;eACM;SACN;eACM;SACN;eACM;SACN;eACM;SACN;eACM;SACN;eACM;QACP;QACA;;;aAGK;eACE;iBACE;mBACE;qBACE;qBACA;qBACA;uBACE;uBACA;;qBAEF;uBACE;;;;iBAIN;mBACE;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;2BACE;;;uBAGJ;yBACE;yBACA;;;;mBAIN;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;2BACE;;;uBAGJ;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;yBACE;;;;;iBAKR;mBACE;qBACE;qBACA;qBACA;uBACE;uBACA;uBACA;;qBAEF;uBACE;uBACA;yBACE;2BACE;2BACA;;;;;mBAKR;qBACE;qBACA;qBACA;uBACE;uBACA;uBACA;;qBAEF;uBACE;uBACA;yBACE;2BACE;2BACA;;;;;;iBAMV;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;iBAKR;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;qBACE;;mBAEF;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;qBAEA;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;qBAEA;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;qBAEA;uBACE;;qBAEF;;qBAEA;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;uBACA;;qBAEF;qBACA;uBACE;;;qBAGF;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;qBACA;uBACE;;;qBAGF;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;uBACE;uBACA;;qBAEF;;qBAEA;uBACE;uBACA;;qBAEF;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;qBAEA;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;uBAEF;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;mBACA;qBACE;;;iBAGJ;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;iBAKR;mBACE;mBACA;mBACA;mBACA;qBACE;qBACA;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;eAMV,WAAW,SAAS,kEAAkE;eACtF,uEAAuE;eACvE,yBAAyB,SAAS;eAClC;iBACE;mBACE;mBACA;mBACA,+DAA+D;YACtE;YACA;YACA;YACA;;mBAEO;qBACE,UAAU,OAAO,oBAAoB,wDAAwD,2BAA2B;;;iBAG5H;mBACE;mBACA;mBACA,+DAA+D;YACtE;YACA;YACA;;mBAEO;qBACE,UAAU,OAAO,+BAA+B;;;iBAGpD;mBACE;mBACA;mBACA,+DAA+D;YACtE;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;;mBAEO;YACP,UAAU,OAAO,yBAAyB,wDAAwD,2BAA2B;YAC7H,eAAe,QAAQ;cACrB;;;;iBAIG;mBACE;mBACA;mBACA,+DAA+D;YACtE;YACA;YACA;YACA;;mBAEO;YACP,UAAU,sCAAsC,wBAAwB,yBAAyB,wDAAwD,2BAA2B;YACpL,iBAAiB,QAAQ;cACvB;cACA;;;;iBAIG;mBACE;mBACA;mBACA,+DAA+D;YACtE;YACA;YACA;;mBAEO;qBACE,UAAU,sCAAsC,4BAA4B;qBAC5E;;;;eAIN;iBACE;UACP;UACA;UACA;UACA;UACA;YACE;;UAEF,aAAa;UACb;qBACW;qBACA;;UAEX;YACE,0CAA0C;cACxC;8CACgC;;;iBAG7B;UACP;UACA;UACA;UACA;UACA;YACE;;UAEF,aAAa;UACb;qBACW;qBACA;;UAEX;YACE,0CAA0C;cACxC;8CACgC;;;iBAG7B;UACP;UACA;UACA;UACA;UACA;YACE;;UAEF,aAAa;UACb;qBACW;qBACA;;UAEX;YACE,0CAA0C;cACxC;8CACgC;;;iBAG7B;UACP;UACA;UACA;UACA;UACA;YACE;;UAEF,aAAa;UACb;qBACW;qBACA;;UAEX;YACE,0CAA0C;cACxC;8CACgC;;;iBAG7B;UACP;UACA;UACA;UACA;UACA;YACE;;UAEF,aAAa;UACb;qBACW;qBACA;;UAEX;YACE,0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;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;eAEF;iBACE;iBACA;iBACA;;;;WAIN;aACE;aACA;aACA;aACA;aACA;aACA;;;WAGF;WACA;aACE,mBAAmB;aACnB,mBAAmB;;WAErB,mCAAmC;WACnC,iCAAiC;WACjC,uBAAuB,UAAU;aAC/B;aACA,aAAa,SAAS;;aAEtB;aACA;aACA;aACA;;aAEA;aACA;aACA,aAAa;aACb;;aAEA;aACA;aACA,OAAO;aACP,kBAAkB;MACzB;MACA"}
|
|
@@ -458,7 +458,50 @@ var PostgresTransactionImpl = class extends PostgresQueryable {
|
|
|
458
458
|
this.#settle();
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
+
async savepoint(name) {
|
|
462
|
+
return openPostgresSavepoint(this.#connection, this.options, name);
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var PostgresSavepointImpl = class extends PostgresQueryable {
|
|
466
|
+
#connection;
|
|
467
|
+
#name;
|
|
468
|
+
constructor(connection, options, name) {
|
|
469
|
+
super(options);
|
|
470
|
+
this.#connection = connection;
|
|
471
|
+
this.#name = name;
|
|
472
|
+
}
|
|
473
|
+
acquireClient() {
|
|
474
|
+
return Promise.resolve(this.#connection);
|
|
475
|
+
}
|
|
476
|
+
releaseClient(_client) {
|
|
477
|
+
return Promise.resolve();
|
|
478
|
+
}
|
|
479
|
+
inExplicitTransaction() {
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
async commit() {
|
|
483
|
+
await sendSavepointStatement(this.#connection, `RELEASE SAVEPOINT ${this.#name}`);
|
|
484
|
+
}
|
|
485
|
+
async rollback() {
|
|
486
|
+
await sendSavepointStatement(this.#connection, `ROLLBACK TO SAVEPOINT ${this.#name}`);
|
|
487
|
+
}
|
|
488
|
+
async savepoint(name) {
|
|
489
|
+
return openPostgresSavepoint(this.#connection, this.options, name);
|
|
490
|
+
}
|
|
461
491
|
};
|
|
492
|
+
async function sendSavepointStatement(connection, sql) {
|
|
493
|
+
const releaseLock = await acquireClientQueryLock(connection);
|
|
494
|
+
try {
|
|
495
|
+
assertClientUsable(connection);
|
|
496
|
+
await connection.query(sql).catch(rethrowClientError(connection));
|
|
497
|
+
} finally {
|
|
498
|
+
releaseLock();
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
async function openPostgresSavepoint(connection, options, name) {
|
|
502
|
+
await sendSavepointStatement(connection, `SAVEPOINT ${name}`);
|
|
503
|
+
return new PostgresSavepointImpl(connection, options, name);
|
|
504
|
+
}
|
|
462
505
|
var PostgresPoolDriverImpl = class extends PostgresQueryable {
|
|
463
506
|
pool;
|
|
464
507
|
#sessionSettings;
|
|
@@ -807,4 +850,4 @@ const postgresRuntimeDriverDescriptor = {
|
|
|
807
850
|
//#endregion
|
|
808
851
|
export { suppressIdleConnectionErrors$1 as n, postgresRuntimeDriverDescriptor as t };
|
|
809
852
|
|
|
810
|
-
//# sourceMappingURL=runtime-
|
|
853
|
+
//# sourceMappingURL=runtime-Cnam1N0o.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-Cnam1N0o.mjs","names":["#queue","#connection","#onRelease","#onDestroy","#txState","#onSettled","#onEnded","#settle","#name","#sessionSettings","#ownedByDriver","#closed","suppressIdleConnectionErrors$1","#connectionMutex","#closeWhileHoldingLease","#giveUpSuppliedClient","#connectFailure","#connected","#rollbackUnderQueryLock","#connectDirectClient","#connectPromise","#connectClient","#cursorOpts","#preparedStatements","#delegate","#disconnectedState","#notConnectedError","#requireDelegate","#wrapConnection"],"sources":["../../../../3-targets/postgres/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as serverTextTypes, c as normalizePgConnectFailure, d as markClientAbandoned, f as watchClientLoss, l as hasLostConnection, n as createPgClient, o as isPostgresError, p as postgresDriverDescriptorMeta, r as createPgPool, s as normalizePgClientError, t as SessionSettingsGuard, u as hasStartedConnecting } from \"./session-settings-cHekxETj.mjs\";\nimport { SqlQueryError } from \"@internal/sql-errors\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { suppressIdleConnectionErrors, suppressIdleConnectionErrors as suppressIdleConnectionErrors$1 } from \"@internal/utils/suppress-idle-connection-errors\";\nimport { validatePostgresIsolationLevel } from \"@internal/target-postgres/runtime\";\nimport Cursor from \"pg-cursor\";\n//#region src/driver-error.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn details === void 0 ? Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\"\n\t}) : Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tdetails\n\t});\n}\n//#endregion\n//#region src/callback-to-promise.ts\nfunction callbackToPromise(fn) {\n\treturn new Promise((resolve, reject) => {\n\t\tfn((err, result) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(result);\n\t\t});\n\t});\n}\n//#endregion\n//#region src/named-cursor.ts\nlet nextNamedPortalId = 1;\n/** Streaming cursor for a server-side named prepared statement. */\nvar NamedCursor = class extends Cursor {\n\tname;\n\tconstructor(opts) {\n\t\tsuper(opts.text, [...opts.values], opts.config);\n\t\tthis.name = opts.name;\n\t\tthis.submit = this.submitNamed;\n\t}\n\tsubmitNamed(connection) {\n\t\tconst self = this;\n\t\tconst conn = connection;\n\t\tself.state = \"submitted\";\n\t\tself.connection = conn;\n\t\tself._portal = `np_${nextNamedPortalId++}`;\n\t\tif (!conn.parsedStatements[this.name]) {\n\t\t\tconst parseMessage = {\n\t\t\t\ttext: self.text,\n\t\t\t\tname: this.name,\n\t\t\t\ttypes: []\n\t\t\t};\n\t\t\tconn.parse(parseMessage, true);\n\t\t}\n\t\tconst bindMessage = {\n\t\t\tportal: self._portal,\n\t\t\tstatement: this.name,\n\t\t\tvalues: self.values ?? []\n\t\t};\n\t\tconn.bind(bindMessage, true);\n\t\tconn.describe({\n\t\t\ttype: \"P\",\n\t\t\tname: self._portal\n\t\t}, true);\n\t\tconn.flush();\n\t\tif (self._conf.types) self._result._getTypeParser = self._conf.types.getTypeParser;\n\t\tconn.once(\"noData\", self._ifNoData);\n\t\tconn.once(\"rowDescription\", self._rowDescription);\n\t}\n};\n//#endregion\n//#region src/postgres-driver.ts\nconst DEFAULT_BATCH_SIZE = 100;\nconst DEFAULT_PREPARED_STATEMENTS = true;\nfunction createHandleAllocator() {\n\tlet next = 1;\n\treturn { mint: () => `pn_${next++}` };\n}\nfunction buildConnectionOptions(options) {\n\treturn {\n\t\t...options.cursor?.disabled ? { cursorDisabled: true } : {\n\t\t\tcursorBatchSize: options.cursor?.batchSize ?? DEFAULT_BATCH_SIZE,\n\t\t\tcursorDisabled: false\n\t\t},\n\t\tpreparedStatementsEnabled: options.preparedStatements ?? DEFAULT_PREPARED_STATEMENTS,\n\t\thandleAllocator: createHandleAllocator()\n\t};\n}\n/** Reads the normalized error that runExecute and runQuery throw; a raw pg error is never stale. */\nfunction isStalePreparedStatementError(error) {\n\tif (!SqlQueryError.is(error)) return false;\n\tconst code = error.sqlState;\n\treturn code === \"26000\" || code === \"0A000\";\n}\nvar AsyncMutex = class {\n\t#queue = Promise.resolve();\n\tasync lock() {\n\t\tconst previous = this.#queue;\n\t\tlet releaseLock;\n\t\tthis.#queue = new Promise((resolve) => {\n\t\t\treleaseLock = resolve;\n\t\t});\n\t\tawait previous;\n\t\treturn () => {\n\t\t\treleaseLock?.();\n\t\t\treleaseLock = void 0;\n\t\t};\n\t}\n};\nconst clientQueryLocks = /* @__PURE__ */ new WeakMap();\nconst clientStreams = /* @__PURE__ */ new WeakMap();\nfunction assertClientUsable(client) {\n\tif (hasLostConnection(client)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection is no longer usable.\");\n}\nasync function closeClientStreams(client) {\n\tawait Promise.all([...clientStreams.get(client) ?? []].map((close) => close()));\n}\nfunction acquireClientQueryLock(client) {\n\tlet mutex = clientQueryLocks.get(client);\n\tif (mutex === void 0) {\n\t\tmutex = new AsyncMutex();\n\t\tclientQueryLocks.set(client, mutex);\n\t}\n\treturn mutex.lock();\n}\nvar PostgresQueryable = class {\n\toptions;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t}\n\tasync *query(request) {\n\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) {\n\t\t\tyield* this.runQuery(request);\n\t\t\treturn;\n\t\t}\n\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\tyield* this.withStaleHandleStreamRetry(preparedStatementHandle, name, (name) => this.runQuery(request, name));\n\t}\n\tasync execute(request) {\n\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) return await this.runExecute(request);\n\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\treturn await this.withStaleHandleRetry(preparedStatementHandle, name, (name) => this.runExecute(request, name));\n\t}\n\tpreparedStatementName(handle) {\n\t\tconst existingName = handle.get();\n\t\tif (typeof existingName === \"string\") return existingName;\n\t\tconst mintedName = this.options.handleAllocator.mint();\n\t\thandle.set(mintedName);\n\t\treturn mintedName;\n\t}\n\tasync withStaleHandleRetry(preparedStatementHandle, name, attempt) {\n\t\ttry {\n\t\t\treturn await attempt(name);\n\t\t} catch (error) {\n\t\t\tif (!isStalePreparedStatementError(error)) throw error;\n\t\t\tconst retryName = this.options.handleAllocator.mint();\n\t\t\tpreparedStatementHandle.set(retryName);\n\t\t\ttry {\n\t\t\t\treturn await attempt(retryName);\n\t\t\t} catch (retryError) {\n\t\t\t\tthrow prepareFailedError(retryError, retryName);\n\t\t\t}\n\t\t}\n\t}\n\tasync *withStaleHandleStreamRetry(preparedStatementHandle, name, attempt) {\n\t\tconst stream = await this.withStaleHandleRetry(preparedStatementHandle, name, async (name) => {\n\t\t\tconst iterator = attempt(name)[Symbol.asyncIterator]();\n\t\t\treturn {\n\t\t\t\titerator,\n\t\t\t\tfirst: await iterator.next()\n\t\t\t};\n\t\t});\n\t\tif (stream.first.done) return;\n\t\tlet streamCompleted = false;\n\t\ttry {\n\t\t\tyield stream.first.value;\n\t\t\twhile (true) {\n\t\t\t\tconst next = await stream.iterator.next();\n\t\t\t\tif (next.done) {\n\t\t\t\t\tstreamCompleted = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tyield next.value;\n\t\t\t}\n\t\t} finally {\n\t\t\tif (!streamCompleted) await stream.iterator.return?.();\n\t\t}\n\t}\n\tasync runExecute(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tassertClientUsable(client);\n\t\t\t\treturn { affectedRows: (await client.query({\n\t\t\t\t\tname,\n\t\t\t\t\ttext: request.sql,\n\t\t\t\t\tvalues: blindCast(request.params ?? [])\n\t\t\t\t})).rowCount ?? 0 };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow normalizePgClientError(client, error);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tinExplicitTransaction() {\n\t\treturn false;\n\t}\n\tasync *runQuery(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\tlet rows;\n\t\ttry {\n\t\t\tif (!this.options.cursorDisabled) {\n\t\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\t\tconst stream = this.streamWithPortalProtection(client, request, this.options.cursorBatchSize, name)[Symbol.asyncIterator]();\n\t\t\t\tlet onEnd = () => {};\n\t\t\t\tconst ended = new Promise((resolve) => {\n\t\t\t\t\tonEnd = resolve;\n\t\t\t\t});\n\t\t\t\tclient.on(\"end\", onEnd);\n\t\t\t\tlet streams = clientStreams.get(client);\n\t\t\t\tif (streams === void 0) {\n\t\t\t\t\tstreams = /* @__PURE__ */ new Set();\n\t\t\t\t\tclientStreams.set(client, streams);\n\t\t\t\t}\n\t\t\t\tconst registered = streams;\n\t\t\t\tlet closing;\n\t\t\t\tconst close = () => closing ??= (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait Promise.race([stream.return?.(), ended]);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tregistered.delete(close);\n\t\t\t\t\t\tclient.removeListener?.(\"end\", onEnd);\n\t\t\t\t\t\treleaseLock();\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\tregistered.add(close);\n\t\t\t\ttry {\n\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\t\tconst next = await stream.next();\n\t\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\t\tif (next.done) break;\n\t\t\t\t\t\tyield blindCast(next.value);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} catch (cursorError) {\n\t\t\t\t\tif (hasLostConnection(client) || !(cursorError instanceof Error) || isPostgresError(cursorError)) throw cursorError;\n\t\t\t\t} finally {\n\t\t\t\t\tawait close();\n\t\t\t\t}\n\t\t\t}\n\t\t\trows = await this.executeBuffered(client, request.sql, request.params, name);\n\t\t} catch (error) {\n\t\t\tthrow normalizePgClientError(client, error);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t\tfor (const row of rows) yield blindCast(row);\n\t}\n\tasync explain(request) {\n\t\tconst text = `EXPLAIN (FORMAT JSON) ${request.sql}`;\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tassertClientUsable(client);\n\t\t\t\treturn { rows: blindCast((await client.query(text, request.params === void 0 ? void 0 : [...request.params]).catch(rethrowClientError(client))).rows) };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tasync *streamWithPortalProtection(client, request, cursorBatchSize, name) {\n\t\tif (this.inExplicitTransaction()) {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t\treturn;\n\t\t}\n\t\tawait client.query(\"BEGIN\");\n\t\tlet streamFailed = false;\n\t\ttry {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t} catch (error) {\n\t\t\tstreamFailed = true;\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tawait this.commitStreamSpan(client, streamFailed);\n\t\t}\n\t}\n\tasync commitStreamSpan(client, streamFailed) {\n\t\ttry {\n\t\t\tawait client.query(\"COMMIT\");\n\t\t} catch (commitError) {\n\t\t\tif (!streamFailed) throw commitError;\n\t\t}\n\t}\n\tasync *executeWithCursor(client, sql, params, cursorBatchSize, name) {\n\t\tconst values = blindCast(params ?? []);\n\t\tconst config = { types: serverTextTypes };\n\t\tconst cursor = client.query(name === void 0 ? new Cursor(sql, values, config) : new NamedCursor({\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues,\n\t\t\tconfig\n\t\t}));\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst rows = await readCursor(cursor, cursorBatchSize);\n\t\t\t\tif (rows.length === 0) break;\n\t\t\t\tfor (const row of rows) yield row;\n\t\t\t}\n\t\t} finally {\n\t\t\tawait closeCursor(cursor);\n\t\t}\n\t}\n\tasync executeBuffered(client, sql, params, name) {\n\t\tconst config = {\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues: blindCast(params ?? []),\n\t\t\ttypes: serverTextTypes\n\t\t};\n\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\tlet result;\n\t\ttry {\n\t\t\tassertClientUsable(client);\n\t\t\tresult = await client.query(config);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\treturn blindCast(result.rows);\n\t}\n};\nvar PostgresConnectionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onRelease;\n\t#onDestroy;\n\t#txState;\n\tconstructor(connection, options, onRelease, onDestroy, txState) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onRelease = onRelease;\n\t\tthis.#onDestroy = onDestroy;\n\t\tthis.#txState = txState ?? {\n\t\t\topen: false,\n\t\t\tunfinishedOnServer: false\n\t\t};\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tasync beginTransaction(start) {\n\t\tconst sql = start?.isolationLevel !== void 0 ? {\n\t\t\tReadUncommitted: \"BEGIN ISOLATION LEVEL READ UNCOMMITTED\",\n\t\t\tReadCommitted: \"BEGIN ISOLATION LEVEL READ COMMITTED\",\n\t\t\tRepeatableRead: \"BEGIN ISOLATION LEVEL REPEATABLE READ\",\n\t\t\tSerializable: \"BEGIN ISOLATION LEVEL SERIALIZABLE\"\n\t\t}[validatePostgresIsolationLevel(start.isolationLevel)] : \"BEGIN\";\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(sql).catch(rethrowClientError(this.#connection));\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\tthis.#txState.open = true;\n\t\tthis.#txState.unfinishedOnServer = true;\n\t\treturn new PostgresTransactionImpl(this.#connection, this.options, () => {\n\t\t\tthis.#txState.open = false;\n\t\t}, () => {\n\t\t\tthis.#txState.unfinishedOnServer = false;\n\t\t});\n\t}\n\tasync release() {\n\t\tconst conn = this.#connection;\n\t\tif (\"release\" in conn) conn.release();\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onRelease = void 0;\n\t\tthis.#onDestroy = void 0;\n\t\tonRelease?.();\n\t}\n\tasync destroy(reason) {\n\t\tconst onDestroy = this.#onDestroy;\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onDestroy = void 0;\n\t\tthis.#onRelease = void 0;\n\t\tconst conn = this.#connection;\n\t\tmarkClientAbandoned(conn);\n\t\tcloseClientStreams(conn).catch(() => void 0);\n\t\tif (\"release\" in conn) {\n\t\t\tconst releaseArg = reason instanceof Error ? reason : /* @__PURE__ */ new Error(\"Connection destroyed\");\n\t\t\tconn.release(releaseArg);\n\t\t}\n\t\tif (onDestroy) await onDestroy(reason);\n\t\telse onRelease?.();\n\t}\n};\nvar PostgresTransactionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onSettled;\n\t#onEnded;\n\tconstructor(connection, options, onSettled, onEnded) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onSettled = onSettled;\n\t\tthis.#onEnded = onEnded;\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn true;\n\t}\n\t#settle() {\n\t\tconst onSettled = this.#onSettled;\n\t\tthis.#onSettled = void 0;\n\t\tonSettled?.();\n\t}\n\tasync commit() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(\"COMMIT\").catch(rethrowClientError(this.#connection));\n\t\t\tthis.#onEnded();\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n\tasync rollback() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(\"ROLLBACK\").catch(rethrowClientError(this.#connection));\n\t\t\tthis.#onEnded();\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n\tasync savepoint(name) {\n\t\treturn openPostgresSavepoint(this.#connection, this.options, name);\n\t}\n};\nvar PostgresSavepointImpl = class extends PostgresQueryable {\n\t#connection;\n\t#name;\n\tconstructor(connection, options, name) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#name = name;\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn true;\n\t}\n\tasync commit() {\n\t\tawait sendSavepointStatement(this.#connection, `RELEASE SAVEPOINT ${this.#name}`);\n\t}\n\tasync rollback() {\n\t\tawait sendSavepointStatement(this.#connection, `ROLLBACK TO SAVEPOINT ${this.#name}`);\n\t}\n\tasync savepoint(name) {\n\t\treturn openPostgresSavepoint(this.#connection, this.options, name);\n\t}\n};\nasync function sendSavepointStatement(connection, sql) {\n\tconst releaseLock = await acquireClientQueryLock(connection);\n\ttry {\n\t\tassertClientUsable(connection);\n\t\tawait connection.query(sql).catch(rethrowClientError(connection));\n\t} finally {\n\t\treleaseLock();\n\t}\n}\nasync function openPostgresSavepoint(connection, options, name) {\n\tawait sendSavepointStatement(connection, `SAVEPOINT ${name}`);\n\treturn new PostgresSavepointImpl(connection, options, name);\n}\nvar PostgresPoolDriverImpl = class extends PostgresQueryable {\n\tpool;\n\t#sessionSettings;\n\t#ownedByDriver;\n\t#closed = false;\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.pool = options.connect.pool;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {}, this.pool);\n\t\tthis.#ownedByDriver = options.connect.ownedByDriver;\n\t}\n\tget state() {\n\t\treturn this.#closed ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\tconst client = await this.acquireClient();\n\t\treturn new PostgresConnectionImpl(client, this.options, () => this.#sessionSettings.forget(client));\n\t}\n\tasync close() {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tif (this.#ownedByDriver) await this.pool.end();\n\t}\n\tasync acquireClient() {\n\t\tlet pooled;\n\t\ttry {\n\t\t\tpooled = await this.pool.connect();\n\t\t} catch (error) {\n\t\t\tthrow normalizePgConnectFailure(error);\n\t\t}\n\t\tconst client = watchClientLoss(suppressIdleConnectionErrors$1(pooled));\n\t\ttry {\n\t\t\tawait ensureSessionSettings(this.#sessionSettings, client);\n\t\t} catch (error) {\n\t\t\tconst normalized = normalizePgClientError(client, error);\n\t\t\tclient.release(true);\n\t\t\tthrow normalized;\n\t\t}\n\t\treturn client;\n\t}\n\tasync releaseClient(client) {\n\t\tclient.release();\n\t}\n};\nvar PostgresDirectDriverImpl = class extends PostgresQueryable {\n\tdirectClient;\n\t#sessionSettings;\n\t#ownedByDriver;\n\t#connectionMutex = new AsyncMutex();\n\t#closed = false;\n\t#connected = false;\n\t#connectPromise;\n\t#connectFailure;\n\t#txState = {\n\t\topen: false,\n\t\tunfinishedOnServer: false\n\t};\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.directClient = watchClientLoss(options.connect.client);\n\t\tthis.#ownedByDriver = options.connect.ownedByDriver;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {}, this.directClient);\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tget state() {\n\t\treturn this.#closed || hasLostConnection(this.directClient) ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\tconst client = await this.acquireClient();\n\t\t\treturn new PostgresConnectionImpl(client, this.options, () => {\n\t\t\t\tthis.#sessionSettings.forget(client);\n\t\t\t\treleaseLease();\n\t\t\t}, async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait this.#closeWhileHoldingLease({ waitForStatement: false });\n\t\t\t\t} finally {\n\t\t\t\t\treleaseLease();\n\t\t\t\t}\n\t\t\t}, this.#txState);\n\t\t} catch (error) {\n\t\t\treleaseLease();\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync close() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\tawait this.#closeWhileHoldingLease({ waitForStatement: true });\n\t\t} finally {\n\t\t\treleaseLease();\n\t\t}\n\t}\n\tasync #closeWhileHoldingLease(options) {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tif (!this.#ownedByDriver) {\n\t\t\tif (!options.waitForStatement) await this.#giveUpSuppliedClient();\n\t\t\treturn;\n\t\t}\n\t\tif (this.#connectFailure !== void 0) {\n\t\t\tthis.directClient.end().catch(() => void 0);\n\t\t\treturn;\n\t\t}\n\t\tconst releaseQueryLock = options.waitForStatement ? await acquireClientQueryLock(this.directClient) : () => {};\n\t\ttry {\n\t\t\tawait this.directClient.end();\n\t\t} finally {\n\t\t\treleaseQueryLock();\n\t\t}\n\t\tthis.#connected = false;\n\t}\n\tasync #giveUpSuppliedClient() {\n\t\tmarkClientAbandoned(this.directClient);\n\t\tawait closeClientStreams(this.directClient).catch(() => void 0);\n\t\tif (this.#txState.unfinishedOnServer) await this.#rollbackUnderQueryLock().catch(() => void 0);\n\t}\n\tasync #rollbackUnderQueryLock() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.directClient);\n\t\ttry {\n\t\t\tawait this.directClient.query(\"ROLLBACK\");\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n\tasync acquireClient() {\n\t\tif (this.#connectFailure !== void 0) throw this.#connectFailure;\n\t\tif (this.#closed || hasLostConnection(this.directClient)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection lost or closed. Create a new client to reconnect.\");\n\t\tif (!this.#connected) await this.#connectDirectClient();\n\t\tawait ensureSessionSettings(this.#sessionSettings, this.directClient).catch(rethrowClientError(this.directClient));\n\t\treturn this.directClient;\n\t}\n\tasync #connectDirectClient() {\n\t\tif (this.#connectPromise === void 0) {\n\t\t\tif (hasStartedConnecting(this.directClient)) {\n\t\t\t\tthis.#connected = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#connectPromise = this.#connectClient();\n\t\t}\n\t\tawait this.#connectPromise;\n\t}\n\tasync #connectClient() {\n\t\ttry {\n\t\t\tawait this.directClient.connect();\n\t\t} catch (error) {\n\t\t\tthis.#connectFailure = normalizePgConnectFailure(error);\n\t\t\tthis.#connectPromise = void 0;\n\t\t\tthrow this.#connectFailure;\n\t\t}\n\t\tthis.#connected = true;\n\t}\n\tasync releaseClient(_client) {}\n};\nfunction createBoundDriverFromBinding(binding, cursorOpts, extraOpts) {\n\tconst preparedStatements = extraOpts?.preparedStatements;\n\tconst sessionSettings = extraOpts?.sessionSettings;\n\tswitch (binding.kind) {\n\t\tcase \"url\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: {\n\t\t\t\tpool: suppressIdleConnectionErrors$1(createPgPool({\n\t\t\t\t\tconnectionString: binding.url,\n\t\t\t\t\tconnectionTimeoutMillis: 2e4,\n\t\t\t\t\tidleTimeoutMillis: 3e4\n\t\t\t\t}, sessionSettings ?? {})),\n\t\t\t\townedByDriver: true\n\t\t\t},\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements,\n\t\t\tsessionSettings\n\t\t});\n\t\tcase \"pgPool\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: {\n\t\t\t\tpool: suppressIdleConnectionErrors$1(binding.pool),\n\t\t\t\townedByDriver: binding.ownedByDriver\n\t\t\t},\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements,\n\t\t\tsessionSettings\n\t\t});\n\t\tcase \"pgClient\":\n\t\t\tif (hasLostConnection(binding.client)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"This pg client lost its connection or was given up by an earlier driver. Create a new client to reconnect.\");\n\t\t\treturn new PostgresDirectDriverImpl({\n\t\t\t\tconnect: {\n\t\t\t\t\tclient: suppressIdleConnectionErrors$1(binding.client),\n\t\t\t\t\townedByDriver: binding.ownedByDriver\n\t\t\t\t},\n\t\t\t\tcursor: cursorOpts,\n\t\t\t\tpreparedStatements,\n\t\t\t\tsessionSettings\n\t\t\t});\n\t}\n}\n/** Ensures the session settings on a client the driver is about to use, holding the client's query lock while it does. */\nasync function ensureSessionSettings(guard, client) {\n\tif (!guard.needs(client)) return;\n\tconst releaseLock = await acquireClientQueryLock(client);\n\ttry {\n\t\tawait guard.ensure(client);\n\t} finally {\n\t\treleaseLock();\n\t}\n}\nfunction readCursor(cursor, size) {\n\treturn callbackToPromise((cb) => {\n\t\tcursor.read(size, (err, rows) => cb(err, rows));\n\t});\n}\nfunction closeCursor(cursor) {\n\treturn callbackToPromise((cb) => cursor.close(cb));\n}\nfunction rethrowClientError(client) {\n\treturn (error) => {\n\t\tthrow normalizePgClientError(client, error);\n\t};\n}\nfunction prepareFailedError(retryError, handle) {\n\tconst cause = retryError instanceof Error ? retryError : new Error(String(retryError));\n\treturn Object.assign(driverError(\"DRIVER.PREPARE_FAILED\", `Prepared statement failed again after re-preparing with a fresh handle: ${cause.message}`, { handle }), { cause });\n}\n//#endregion\n//#region src/exports/runtime.ts\nconst USE_BEFORE_CONNECT_MESSAGE = \"Postgres driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst CLOSED_MESSAGE = \"Postgres driver is closed. Call connect(binding) to reconnect.\";\nconst CONNECTION_LOST_MESSAGE = \"Postgres connection lost or closed. Call connect(binding) to reconnect.\";\nconst ALREADY_CONNECTED_MESSAGE = \"Postgres driver already connected. Call close() before reconnecting with a new binding.\";\nfunction unboundQuery(notConnected) {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow notConnected();\n\t\t} };\n\t} };\n}\nconst notConnectedMessages = {\n\tunbound: USE_BEFORE_CONNECT_MESSAGE,\n\tclosed: CLOSED_MESSAGE,\n\tconnectionLost: CONNECTION_LOST_MESSAGE\n};\nvar PostgresUnboundDriverImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\t#delegate = null;\n\t#disconnectedState = \"unbound\";\n\t#cursorOpts;\n\t#preparedStatements;\n\t#sessionSettings;\n\tconstructor(options) {\n\t\tthis.#cursorOpts = options?.cursor;\n\t\tthis.#preparedStatements = options?.preparedStatements;\n\t\tthis.#sessionSettings = options?.sessionSettings;\n\t}\n\tget state() {\n\t\tif (this.#delegate !== null) return \"connected\";\n\t\treturn this.#disconnectedState === \"unbound\" ? \"unbound\" : \"closed\";\n\t}\n\t#notConnectedError() {\n\t\treturn driverError(\"DRIVER.NOT_CONNECTED\", notConnectedMessages[this.#disconnectedState]);\n\t}\n\t#requireDelegate() {\n\t\tconst delegate = this.#delegate;\n\t\tif (delegate === null) throw this.#notConnectedError();\n\t\treturn delegate;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#delegate !== null) throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#delegate = createBoundDriverFromBinding(binding, this.#cursorOpts, {\n\t\t\tpreparedStatements: this.#preparedStatements,\n\t\t\tsessionSettings: this.#sessionSettings\n\t\t});\n\t\tthis.#disconnectedState = \"unbound\";\n\t}\n\tasync acquireConnection() {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst connection = await delegate.acquireConnection();\n\t\treturn this.#wrapConnection(connection, delegate);\n\t}\n\t/**\n\t* Wraps an acquired connection so that teardown paths which close the\n\t* underlying delegate (notably `destroy()` on a pgClient binding, where\n\t* the single socket means a destroyed connection invalidates the driver)\n\t* also reset our own `#delegate` reference. Without this, a failed\n\t* transaction rollback would leave the outer unbound wrapper reporting\n\t* `connected` while routing subsequent work to an already-ended delegate.\n\t*/\n\t#wrapConnection(connection, delegate) {\n\t\tconst syncDelegateState = () => {\n\t\t\tif (this.#delegate === delegate && delegate.state === \"closed\") {\n\t\t\t\tthis.#delegate = null;\n\t\t\t\tthis.#disconnectedState = \"connectionLost\";\n\t\t\t}\n\t\t};\n\t\tconst wrapped = {\n\t\t\tbeginTransaction: connection.beginTransaction.bind(connection),\n\t\t\tquery: connection.query.bind(connection),\n\t\t\texecute: connection.execute.bind(connection),\n\t\t\trelease: async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.release();\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t},\n\t\t\tdestroy: async (reason) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.destroy(reason);\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tif (connection.explain) wrapped.explain = connection.explain.bind(connection);\n\t\treturn wrapped;\n\t}\n\tasync close() {\n\t\tconst delegate = this.#delegate;\n\t\tthis.#delegate = null;\n\t\tthis.#disconnectedState = \"closed\";\n\t\tawait delegate?.close();\n\t}\n\tquery(request) {\n\t\tconst delegate = this.#delegate;\n\t\treturn delegate === null ? unboundQuery(() => this.#notConnectedError()) : delegate.query(request);\n\t}\n\tasync execute(request) {\n\t\treturn this.#requireDelegate().execute(request);\n\t}\n\tasync explain(request) {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst explain = delegate.explain;\n\t\tif (explain === void 0) throw driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\treturn explain.call(delegate, request);\n\t}\n};\nconst postgresRuntimeDriverDescriptor = {\n\t...postgresDriverDescriptorMeta,\n\tcreate(options, sessionSettings) {\n\t\treturn new PostgresUnboundDriverImpl({\n\t\t\t...options,\n\t\t\t...ifDefined(\"sessionSettings\", sessionSettings)\n\t\t});\n\t}\n};\n//#endregion\nexport { createPgClient, createPgPool, postgresRuntimeDriverDescriptor as default, suppressIdleConnectionErrors };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,MAAM,OAAO;CAC/B,OAAO,eAA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ACD;EACA,MAAM,UAAU;GACf,kBAAkB,WAAW,iBAAiB,KAAK,UAAU;GAC7D,OAAO,WAAW,MAAM,KAAK,UAAU;GACvC,SAAS,WAAW,QAAQ,KAAK,UAAU;GAC3C,SAAS,YAAY;IACpB,IAAI;KACH,MAAM,WAAW,QAAQ;IAC1B,UAAU;KACT,kBAAkB;IACnB;GACD;GACA,SAAS,OAAO,WAAW;IAC1B,IAAI;KACH,MAAM,WAAW,QAAQ,MAAM;IAChC,UAAU;KACT,kBAAkB;IACnB;GACD;EACD;EACA,IAAI,WAAW,SAAS,QAAQ,UAAU,WAAW,QAAQ,KAAK,UAAU;EAC5E,OAAO;CACR;CACA,MAAM,QAAQ;EACb,MAAM,WAAW,KAAKD;EACtB,KAAKA,YAAY;EACjB,KAAKC,qBAAqB;EAC1B,MAAM,UAAU,MAAM;CACvB;CACA,MAAM,SAAS;EACd,MAAM,WAAW,KAAKD;EACtB,OAAO,aAAa,OAAO,mBAAmB,KAAKE,mBAAmB,CAAC,IAAI,SAAS,MAAM,OAAO;CAClG;CACA,MAAM,QAAQ,SAAS;EACtB,OAAO,KAAKC,iBAAiB,CAAC,CAAC,QAAQ,OAAO;CAC/C;CACA,MAAM,QAAQ,SAAS;EACtB,MAAM,WAAW,KAAKA,iBAAiB;EACvC,MAAM,UAAU,SAAS;EACzB,IAAI,YAAY,KAAK,GAAG,MAAM,YAAY,wBAAwB,0BAA0B;EAC5F,OAAO,QAAQ,KAAK,UAAU,OAAO;CACtC;AACD;AACA,MAAM,kCAAkC;CACvC,GAAG;CACH,OAAO,SAAS,iBAAiB;EAChC,OAAO,IAAI,0BAA0B;GACpC,GAAG;GACH,GAAG,UAAU,mBAAmB,eAAe;EAChD,CAAC;CACF;AACD"}
|
package/dist/target.d.mts
CHANGED
|
@@ -18,7 +18,7 @@ import "./ddl-B8nQZTWN.mjs";
|
|
|
18
18
|
import "./codec-ids-JTQCwgBI.mjs";
|
|
19
19
|
import { a as FullTextIndexCandidate, c as FullTextSearchLanguage, d as fullTextIndexProblems, f as weightGroupsOf, i as FullTextFieldsInput, n as FULL_TEXT_INDEX_TYPE, o as FullTextIndexDefinition, r as FullTextColumnCodecs, s as FullTextIndexProblem, t as DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, u as describeFullTextIndexProblem } from "./full-text-index-definition-D5iBWLss-BEpqiucV.mjs";
|
|
20
20
|
import { a as quoteQualifiedName, i as quoteIdentifier, n as inlineLiteral, o as renderFullTextIndexDocument, r as qualifyName, s as validateEnumValueLength, t as escapeLiteral } from "./sql-utils-Bq4nuPvy.mjs";
|
|
21
|
-
import { t as postgresAggregateDescriptors } from "./aggregates-
|
|
21
|
+
import { t as postgresAggregateDescriptors } from "./aggregates-CJGvlOCM.mjs";
|
|
22
22
|
import { a as Numeric, c as TimestampString, d as VarBit, f as Varchar, i as JsonValue$1, l as TimestamptzString, n as Char, o as ParameterizedOutputTypesForTypeParams, r as CodecTypes, s as TimeString, t as Bit, u as Timetz } from "./codec-types-xyW4TiJD-CRDK7QcS.mjs";
|
|
23
23
|
import "./codec-types-FPJG3oQH.mjs";
|
|
24
24
|
import { A as jsonb, B as textArray, C as createTable, D as indexExistsAst, E as extensionInSchemaAst, F as sequenceNameAvailableAst, H as timestamptzJsDate, I as tableExistsAst, L as tableIsEmptyAst, M as pgTable, N as rlsEnabledAst, O as int4, P as rlsPolicyExistsAst, R as tablePrimaryKeyAst, S as createSchema, T as extensionExistsAst, U as toRegclass, V as timestamptz, _ as columnDefaultSequenceAst, a as IndexExistsCheckBuilder, b as columnTypeAst, c as TableExistsCheckBuilder, d as addConstraintAction, f as alterColumnTypeAction, g as columnDefaultAst, h as buildSignMarkerBootstrapQueries, i as ExtensionExistsCheckBuilder, j as noNullValuesAst, k as int8, l as TablePrimaryKeyCheckBuilder, m as buildControlTableBootstrapQueries, n as ColumnExistsCheckBuilder, o as RlsEnabledCheckBuilder, p as alterTable, r as ConstraintExistsCheckBuilder, s as RlsPolicyExistsCheckBuilder, t as ColumnDefaultCheckBuilder, u as addColumnAction, v as columnExistsAst, w as dropDefaultAction, x as constraintExistsAst, y as columnNullabilityAst, z as text } from "./contract-free-DcaYH2c5.mjs";
|
|
@@ -45,7 +45,7 @@ import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n
|
|
|
45
45
|
import { n as IntrospectedTypeText, r as introspectedTypeText, t as CatalogColumnType } from "./native-type-normalizer-BaGa9eeb.mjs";
|
|
46
46
|
import "./op-factory-call-DRapuFEI.mjs";
|
|
47
47
|
import "./operation-types-CdMQcokE.mjs";
|
|
48
|
-
import "./pack-
|
|
48
|
+
import "./pack-DgJcT8hM.mjs";
|
|
49
49
|
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-CDkRlHah-Cknq9LDt.mjs";
|
|
50
50
|
import { n as createPostgresMigrationPlanner, t as contractToPostgresDatabaseSchemaNode } from "./planner-CyyWVHw4.mjs";
|
|
51
51
|
import { t as buildColumnTypeSql } from "./planner-ddl-builders-CPM3y7cQ.mjs";
|
|
@@ -53,7 +53,7 @@ import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./pla
|
|
|
53
53
|
import "./planner-produced-postgres-migration-Davk_RXL.mjs";
|
|
54
54
|
import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-ceCNOGFf.mjs";
|
|
55
55
|
import "./planner-sql-checks-rEjFx_Jv.mjs";
|
|
56
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
56
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-B0Toqx_S.mjs";
|
|
57
57
|
import { t as renderOps } from "./render-ops-CEwI8Iyf.mjs";
|
|
58
58
|
import { t as renderCallsToTypeScript } from "./render-typescript-BysdXYpH.mjs";
|
|
59
59
|
import { a as postgresIsolationLevelSchema, c as validatePostgresIsolationLevel, i as PostgresRuntimeTargetInstance, n as PostgresIsolationLevel, o as postgresIsolationLevels, r as PostgresListDecoder, t as PostgresContractSerializer } from "./runtime-DNHLyT94.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as postgresAggregateDescriptors } from "./aggregates-
|
|
1
|
+
import { t as postgresAggregateDescriptors } from "./aggregates-CJGvlOCM.mjs";
|
|
2
2
|
export { postgresAggregateDescriptors };
|
package/dist/target__pack.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { p as TsqueryParser, t as FullTextDocument } from "./operation-types-DrbqAMZU-BMJy_GWl.mjs";
|
|
2
|
-
import { t as postgresTargetDescriptorMeta } from "./pack-
|
|
2
|
+
import { t as postgresTargetDescriptorMeta } from "./pack-DgJcT8hM.mjs";
|
|
3
3
|
export { type FullTextDocument, type TsqueryParser, postgresTargetDescriptorMeta as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
1
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-B0Toqx_S.mjs";
|
|
2
2
|
export { prisma7PostgresBinding };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-target-postgres",
|
|
3
|
-
"version": "8.0.0-rc.24
|
|
3
|
+
"version": "8.0.0-rc.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@prisma/orm-family-sql": "8.0.0-rc.24
|
|
13
|
-
"@prisma/orm-framework": "8.0.0-rc.24
|
|
14
|
-
"@prisma/orm-toolchain": "8.0.0-rc.24
|
|
12
|
+
"@prisma/orm-family-sql": "8.0.0-rc.24",
|
|
13
|
+
"@prisma/orm-framework": "8.0.0-rc.24",
|
|
14
|
+
"@prisma/orm-toolchain": "8.0.0-rc.24",
|
|
15
15
|
"@standard-schema/spec": "^1.1.0",
|
|
16
16
|
"@types/node": "26.1.2",
|
|
17
17
|
"@types/pg": "8.20.4",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"temporal-spec": "1.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@internal/adapter-postgres": "8.0.0-rc.24
|
|
28
|
-
"@internal/driver-postgres": "8.0.0-rc.24
|
|
29
|
-
"@internal/target-postgres": "8.0.0-rc.24
|
|
30
|
-
"@repo/test-utils": "8.0.0-rc.24
|
|
31
|
-
"@repo/tsconfig": "8.0.0-rc.24
|
|
32
|
-
"@repo/tsdown": "8.0.0-rc.24
|
|
27
|
+
"@internal/adapter-postgres": "8.0.0-rc.24",
|
|
28
|
+
"@internal/driver-postgres": "8.0.0-rc.24",
|
|
29
|
+
"@internal/target-postgres": "8.0.0-rc.24",
|
|
30
|
+
"@repo/test-utils": "8.0.0-rc.24",
|
|
31
|
+
"@repo/tsconfig": "8.0.0-rc.24",
|
|
32
|
+
"@repo/tsdown": "8.0.0-rc.24",
|
|
33
33
|
"tsdown": "0.22.14",
|
|
34
34
|
"typescript": "5.9.3",
|
|
35
35
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DuP4WGEr.mjs","names":["#queue","#connection","#onRelease","#onDestroy","#txState","#onSettled","#onEnded","#settle","#sessionSettings","#ownedByDriver","#closed","suppressIdleConnectionErrors$1","#connectionMutex","#closeWhileHoldingLease","#giveUpSuppliedClient","#connectFailure","#connected","#rollbackUnderQueryLock","#connectDirectClient","#connectPromise","#connectClient","#cursorOpts","#preparedStatements","#delegate","#disconnectedState","#notConnectedError","#requireDelegate","#wrapConnection"],"sources":["../../../../3-targets/postgres/3-driver/dist/runtime.mjs"],"sourcesContent":["import { a as serverTextTypes, c as normalizePgConnectFailure, d as markClientAbandoned, f as watchClientLoss, l as hasLostConnection, n as createPgClient, o as isPostgresError, p as postgresDriverDescriptorMeta, r as createPgPool, s as normalizePgClientError, t as SessionSettingsGuard, u as hasStartedConnecting } from \"./session-settings-cHekxETj.mjs\";\nimport { SqlQueryError } from \"@internal/sql-errors\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { suppressIdleConnectionErrors, suppressIdleConnectionErrors as suppressIdleConnectionErrors$1 } from \"@internal/utils/suppress-idle-connection-errors\";\nimport { validatePostgresIsolationLevel } from \"@internal/target-postgres/runtime\";\nimport Cursor from \"pg-cursor\";\n//#region src/driver-error.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn details === void 0 ? Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\"\n\t}) : Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tdetails\n\t});\n}\n//#endregion\n//#region src/callback-to-promise.ts\nfunction callbackToPromise(fn) {\n\treturn new Promise((resolve, reject) => {\n\t\tfn((err, result) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(result);\n\t\t});\n\t});\n}\n//#endregion\n//#region src/named-cursor.ts\nlet nextNamedPortalId = 1;\n/** Streaming cursor for a server-side named prepared statement. */\nvar NamedCursor = class extends Cursor {\n\tname;\n\tconstructor(opts) {\n\t\tsuper(opts.text, [...opts.values], opts.config);\n\t\tthis.name = opts.name;\n\t\tthis.submit = this.submitNamed;\n\t}\n\tsubmitNamed(connection) {\n\t\tconst self = this;\n\t\tconst conn = connection;\n\t\tself.state = \"submitted\";\n\t\tself.connection = conn;\n\t\tself._portal = `np_${nextNamedPortalId++}`;\n\t\tif (!conn.parsedStatements[this.name]) {\n\t\t\tconst parseMessage = {\n\t\t\t\ttext: self.text,\n\t\t\t\tname: this.name,\n\t\t\t\ttypes: []\n\t\t\t};\n\t\t\tconn.parse(parseMessage, true);\n\t\t}\n\t\tconst bindMessage = {\n\t\t\tportal: self._portal,\n\t\t\tstatement: this.name,\n\t\t\tvalues: self.values ?? []\n\t\t};\n\t\tconn.bind(bindMessage, true);\n\t\tconn.describe({\n\t\t\ttype: \"P\",\n\t\t\tname: self._portal\n\t\t}, true);\n\t\tconn.flush();\n\t\tif (self._conf.types) self._result._getTypeParser = self._conf.types.getTypeParser;\n\t\tconn.once(\"noData\", self._ifNoData);\n\t\tconn.once(\"rowDescription\", self._rowDescription);\n\t}\n};\n//#endregion\n//#region src/postgres-driver.ts\nconst DEFAULT_BATCH_SIZE = 100;\nconst DEFAULT_PREPARED_STATEMENTS = true;\nfunction createHandleAllocator() {\n\tlet next = 1;\n\treturn { mint: () => `pn_${next++}` };\n}\nfunction buildConnectionOptions(options) {\n\treturn {\n\t\t...options.cursor?.disabled ? { cursorDisabled: true } : {\n\t\t\tcursorBatchSize: options.cursor?.batchSize ?? DEFAULT_BATCH_SIZE,\n\t\t\tcursorDisabled: false\n\t\t},\n\t\tpreparedStatementsEnabled: options.preparedStatements ?? DEFAULT_PREPARED_STATEMENTS,\n\t\thandleAllocator: createHandleAllocator()\n\t};\n}\n/** Reads the normalized error that runExecute and runQuery throw; a raw pg error is never stale. */\nfunction isStalePreparedStatementError(error) {\n\tif (!SqlQueryError.is(error)) return false;\n\tconst code = error.sqlState;\n\treturn code === \"26000\" || code === \"0A000\";\n}\nvar AsyncMutex = class {\n\t#queue = Promise.resolve();\n\tasync lock() {\n\t\tconst previous = this.#queue;\n\t\tlet releaseLock;\n\t\tthis.#queue = new Promise((resolve) => {\n\t\t\treleaseLock = resolve;\n\t\t});\n\t\tawait previous;\n\t\treturn () => {\n\t\t\treleaseLock?.();\n\t\t\treleaseLock = void 0;\n\t\t};\n\t}\n};\nconst clientQueryLocks = /* @__PURE__ */ new WeakMap();\nconst clientStreams = /* @__PURE__ */ new WeakMap();\nfunction assertClientUsable(client) {\n\tif (hasLostConnection(client)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection is no longer usable.\");\n}\nasync function closeClientStreams(client) {\n\tawait Promise.all([...clientStreams.get(client) ?? []].map((close) => close()));\n}\nfunction acquireClientQueryLock(client) {\n\tlet mutex = clientQueryLocks.get(client);\n\tif (mutex === void 0) {\n\t\tmutex = new AsyncMutex();\n\t\tclientQueryLocks.set(client, mutex);\n\t}\n\treturn mutex.lock();\n}\nvar PostgresQueryable = class {\n\toptions;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t}\n\tasync *query(request) {\n\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) {\n\t\t\tyield* this.runQuery(request);\n\t\t\treturn;\n\t\t}\n\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\tyield* this.withStaleHandleStreamRetry(preparedStatementHandle, name, (name) => this.runQuery(request, name));\n\t}\n\tasync execute(request) {\n\t\tconst preparedStatementHandle = request.preparedStatementHandle;\n\t\tif (preparedStatementHandle === void 0 || !this.options.preparedStatementsEnabled) return await this.runExecute(request);\n\t\tconst name = this.preparedStatementName(preparedStatementHandle);\n\t\treturn await this.withStaleHandleRetry(preparedStatementHandle, name, (name) => this.runExecute(request, name));\n\t}\n\tpreparedStatementName(handle) {\n\t\tconst existingName = handle.get();\n\t\tif (typeof existingName === \"string\") return existingName;\n\t\tconst mintedName = this.options.handleAllocator.mint();\n\t\thandle.set(mintedName);\n\t\treturn mintedName;\n\t}\n\tasync withStaleHandleRetry(preparedStatementHandle, name, attempt) {\n\t\ttry {\n\t\t\treturn await attempt(name);\n\t\t} catch (error) {\n\t\t\tif (!isStalePreparedStatementError(error)) throw error;\n\t\t\tconst retryName = this.options.handleAllocator.mint();\n\t\t\tpreparedStatementHandle.set(retryName);\n\t\t\ttry {\n\t\t\t\treturn await attempt(retryName);\n\t\t\t} catch (retryError) {\n\t\t\t\tthrow prepareFailedError(retryError, retryName);\n\t\t\t}\n\t\t}\n\t}\n\tasync *withStaleHandleStreamRetry(preparedStatementHandle, name, attempt) {\n\t\tconst stream = await this.withStaleHandleRetry(preparedStatementHandle, name, async (name) => {\n\t\t\tconst iterator = attempt(name)[Symbol.asyncIterator]();\n\t\t\treturn {\n\t\t\t\titerator,\n\t\t\t\tfirst: await iterator.next()\n\t\t\t};\n\t\t});\n\t\tif (stream.first.done) return;\n\t\tlet streamCompleted = false;\n\t\ttry {\n\t\t\tyield stream.first.value;\n\t\t\twhile (true) {\n\t\t\t\tconst next = await stream.iterator.next();\n\t\t\t\tif (next.done) {\n\t\t\t\t\tstreamCompleted = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tyield next.value;\n\t\t\t}\n\t\t} finally {\n\t\t\tif (!streamCompleted) await stream.iterator.return?.();\n\t\t}\n\t}\n\tasync runExecute(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tassertClientUsable(client);\n\t\t\t\treturn { affectedRows: (await client.query({\n\t\t\t\t\tname,\n\t\t\t\t\ttext: request.sql,\n\t\t\t\t\tvalues: blindCast(request.params ?? [])\n\t\t\t\t})).rowCount ?? 0 };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthrow normalizePgClientError(client, error);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tinExplicitTransaction() {\n\t\treturn false;\n\t}\n\tasync *runQuery(request, name) {\n\t\tconst client = await this.acquireClient();\n\t\tlet rows;\n\t\ttry {\n\t\t\tif (!this.options.cursorDisabled) {\n\t\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\t\tconst stream = this.streamWithPortalProtection(client, request, this.options.cursorBatchSize, name)[Symbol.asyncIterator]();\n\t\t\t\tlet onEnd = () => {};\n\t\t\t\tconst ended = new Promise((resolve) => {\n\t\t\t\t\tonEnd = resolve;\n\t\t\t\t});\n\t\t\t\tclient.on(\"end\", onEnd);\n\t\t\t\tlet streams = clientStreams.get(client);\n\t\t\t\tif (streams === void 0) {\n\t\t\t\t\tstreams = /* @__PURE__ */ new Set();\n\t\t\t\t\tclientStreams.set(client, streams);\n\t\t\t\t}\n\t\t\t\tconst registered = streams;\n\t\t\t\tlet closing;\n\t\t\t\tconst close = () => closing ??= (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait Promise.race([stream.return?.(), ended]);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tregistered.delete(close);\n\t\t\t\t\t\tclient.removeListener?.(\"end\", onEnd);\n\t\t\t\t\t\treleaseLock();\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\tregistered.add(close);\n\t\t\t\ttry {\n\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\t\tconst next = await stream.next();\n\t\t\t\t\t\tassertClientUsable(client);\n\t\t\t\t\t\tif (next.done) break;\n\t\t\t\t\t\tyield blindCast(next.value);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} catch (cursorError) {\n\t\t\t\t\tif (hasLostConnection(client) || !(cursorError instanceof Error) || isPostgresError(cursorError)) throw cursorError;\n\t\t\t\t} finally {\n\t\t\t\t\tawait close();\n\t\t\t\t}\n\t\t\t}\n\t\t\trows = await this.executeBuffered(client, request.sql, request.params, name);\n\t\t} catch (error) {\n\t\t\tthrow normalizePgClientError(client, error);\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t\tfor (const row of rows) yield blindCast(row);\n\t}\n\tasync explain(request) {\n\t\tconst text = `EXPLAIN (FORMAT JSON) ${request.sql}`;\n\t\tconst client = await this.acquireClient();\n\t\ttry {\n\t\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\t\ttry {\n\t\t\t\tassertClientUsable(client);\n\t\t\t\treturn { rows: blindCast((await client.query(text, request.params === void 0 ? void 0 : [...request.params]).catch(rethrowClientError(client))).rows) };\n\t\t\t} finally {\n\t\t\t\treleaseLock();\n\t\t\t}\n\t\t} finally {\n\t\t\tawait this.releaseClient(client);\n\t\t}\n\t}\n\tasync *streamWithPortalProtection(client, request, cursorBatchSize, name) {\n\t\tif (this.inExplicitTransaction()) {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t\treturn;\n\t\t}\n\t\tawait client.query(\"BEGIN\");\n\t\tlet streamFailed = false;\n\t\ttry {\n\t\t\tyield* this.executeWithCursor(client, request.sql, request.params, cursorBatchSize, name);\n\t\t} catch (error) {\n\t\t\tstreamFailed = true;\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tawait this.commitStreamSpan(client, streamFailed);\n\t\t}\n\t}\n\tasync commitStreamSpan(client, streamFailed) {\n\t\ttry {\n\t\t\tawait client.query(\"COMMIT\");\n\t\t} catch (commitError) {\n\t\t\tif (!streamFailed) throw commitError;\n\t\t}\n\t}\n\tasync *executeWithCursor(client, sql, params, cursorBatchSize, name) {\n\t\tconst values = blindCast(params ?? []);\n\t\tconst config = { types: serverTextTypes };\n\t\tconst cursor = client.query(name === void 0 ? new Cursor(sql, values, config) : new NamedCursor({\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues,\n\t\t\tconfig\n\t\t}));\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst rows = await readCursor(cursor, cursorBatchSize);\n\t\t\t\tif (rows.length === 0) break;\n\t\t\t\tfor (const row of rows) yield row;\n\t\t\t}\n\t\t} finally {\n\t\t\tawait closeCursor(cursor);\n\t\t}\n\t}\n\tasync executeBuffered(client, sql, params, name) {\n\t\tconst config = {\n\t\t\tname,\n\t\t\ttext: sql,\n\t\t\tvalues: blindCast(params ?? []),\n\t\t\ttypes: serverTextTypes\n\t\t};\n\t\tconst releaseLock = await acquireClientQueryLock(client);\n\t\tlet result;\n\t\ttry {\n\t\t\tassertClientUsable(client);\n\t\t\tresult = await client.query(config);\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\treturn blindCast(result.rows);\n\t}\n};\nvar PostgresConnectionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onRelease;\n\t#onDestroy;\n\t#txState;\n\tconstructor(connection, options, onRelease, onDestroy, txState) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onRelease = onRelease;\n\t\tthis.#onDestroy = onDestroy;\n\t\tthis.#txState = txState ?? {\n\t\t\topen: false,\n\t\t\tunfinishedOnServer: false\n\t\t};\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tasync beginTransaction(start) {\n\t\tconst sql = start?.isolationLevel !== void 0 ? {\n\t\t\tReadUncommitted: \"BEGIN ISOLATION LEVEL READ UNCOMMITTED\",\n\t\t\tReadCommitted: \"BEGIN ISOLATION LEVEL READ COMMITTED\",\n\t\t\tRepeatableRead: \"BEGIN ISOLATION LEVEL REPEATABLE READ\",\n\t\t\tSerializable: \"BEGIN ISOLATION LEVEL SERIALIZABLE\"\n\t\t}[validatePostgresIsolationLevel(start.isolationLevel)] : \"BEGIN\";\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(sql).catch(rethrowClientError(this.#connection));\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t\tthis.#txState.open = true;\n\t\tthis.#txState.unfinishedOnServer = true;\n\t\treturn new PostgresTransactionImpl(this.#connection, this.options, () => {\n\t\t\tthis.#txState.open = false;\n\t\t}, () => {\n\t\t\tthis.#txState.unfinishedOnServer = false;\n\t\t});\n\t}\n\tasync release() {\n\t\tconst conn = this.#connection;\n\t\tif (\"release\" in conn) conn.release();\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onRelease = void 0;\n\t\tthis.#onDestroy = void 0;\n\t\tonRelease?.();\n\t}\n\tasync destroy(reason) {\n\t\tconst onDestroy = this.#onDestroy;\n\t\tconst onRelease = this.#onRelease;\n\t\tthis.#onDestroy = void 0;\n\t\tthis.#onRelease = void 0;\n\t\tconst conn = this.#connection;\n\t\tmarkClientAbandoned(conn);\n\t\tcloseClientStreams(conn).catch(() => void 0);\n\t\tif (\"release\" in conn) {\n\t\t\tconst releaseArg = reason instanceof Error ? reason : /* @__PURE__ */ new Error(\"Connection destroyed\");\n\t\t\tconn.release(releaseArg);\n\t\t}\n\t\tif (onDestroy) await onDestroy(reason);\n\t\telse onRelease?.();\n\t}\n};\nvar PostgresTransactionImpl = class extends PostgresQueryable {\n\t#connection;\n\t#onSettled;\n\t#onEnded;\n\tconstructor(connection, options, onSettled, onEnded) {\n\t\tsuper(options);\n\t\tthis.#connection = connection;\n\t\tthis.#onSettled = onSettled;\n\t\tthis.#onEnded = onEnded;\n\t}\n\tacquireClient() {\n\t\treturn Promise.resolve(this.#connection);\n\t}\n\treleaseClient(_client) {\n\t\treturn Promise.resolve();\n\t}\n\tinExplicitTransaction() {\n\t\treturn true;\n\t}\n\t#settle() {\n\t\tconst onSettled = this.#onSettled;\n\t\tthis.#onSettled = void 0;\n\t\tonSettled?.();\n\t}\n\tasync commit() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(\"COMMIT\").catch(rethrowClientError(this.#connection));\n\t\t\tthis.#onEnded();\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n\tasync rollback() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.#connection);\n\t\ttry {\n\t\t\tassertClientUsable(this.#connection);\n\t\t\tawait this.#connection.query(\"ROLLBACK\").catch(rethrowClientError(this.#connection));\n\t\t\tthis.#onEnded();\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t\tthis.#settle();\n\t\t}\n\t}\n};\nvar PostgresPoolDriverImpl = class extends PostgresQueryable {\n\tpool;\n\t#sessionSettings;\n\t#ownedByDriver;\n\t#closed = false;\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.pool = options.connect.pool;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {}, this.pool);\n\t\tthis.#ownedByDriver = options.connect.ownedByDriver;\n\t}\n\tget state() {\n\t\treturn this.#closed ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\tconst client = await this.acquireClient();\n\t\treturn new PostgresConnectionImpl(client, this.options, () => this.#sessionSettings.forget(client));\n\t}\n\tasync close() {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tif (this.#ownedByDriver) await this.pool.end();\n\t}\n\tasync acquireClient() {\n\t\tlet pooled;\n\t\ttry {\n\t\t\tpooled = await this.pool.connect();\n\t\t} catch (error) {\n\t\t\tthrow normalizePgConnectFailure(error);\n\t\t}\n\t\tconst client = watchClientLoss(suppressIdleConnectionErrors$1(pooled));\n\t\ttry {\n\t\t\tawait ensureSessionSettings(this.#sessionSettings, client);\n\t\t} catch (error) {\n\t\t\tconst normalized = normalizePgClientError(client, error);\n\t\t\tclient.release(true);\n\t\t\tthrow normalized;\n\t\t}\n\t\treturn client;\n\t}\n\tasync releaseClient(client) {\n\t\tclient.release();\n\t}\n};\nvar PostgresDirectDriverImpl = class extends PostgresQueryable {\n\tdirectClient;\n\t#sessionSettings;\n\t#ownedByDriver;\n\t#connectionMutex = new AsyncMutex();\n\t#closed = false;\n\t#connected = false;\n\t#connectPromise;\n\t#connectFailure;\n\t#txState = {\n\t\topen: false,\n\t\tunfinishedOnServer: false\n\t};\n\tconstructor(options) {\n\t\tsuper(buildConnectionOptions(options));\n\t\tthis.directClient = watchClientLoss(options.connect.client);\n\t\tthis.#ownedByDriver = options.connect.ownedByDriver;\n\t\tthis.#sessionSettings = new SessionSettingsGuard(options.sessionSettings ?? {}, this.directClient);\n\t}\n\tinExplicitTransaction() {\n\t\treturn this.#txState.open;\n\t}\n\tget state() {\n\t\treturn this.#closed || hasLostConnection(this.directClient) ? \"closed\" : \"connected\";\n\t}\n\tasync connect(_binding) {}\n\tasync acquireConnection() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\tconst client = await this.acquireClient();\n\t\t\treturn new PostgresConnectionImpl(client, this.options, () => {\n\t\t\t\tthis.#sessionSettings.forget(client);\n\t\t\t\treleaseLease();\n\t\t\t}, async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait this.#closeWhileHoldingLease({ waitForStatement: false });\n\t\t\t\t} finally {\n\t\t\t\t\treleaseLease();\n\t\t\t\t}\n\t\t\t}, this.#txState);\n\t\t} catch (error) {\n\t\t\treleaseLease();\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync close() {\n\t\tconst releaseLease = await this.#connectionMutex.lock();\n\t\ttry {\n\t\t\tawait this.#closeWhileHoldingLease({ waitForStatement: true });\n\t\t} finally {\n\t\t\treleaseLease();\n\t\t}\n\t}\n\tasync #closeWhileHoldingLease(options) {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tif (!this.#ownedByDriver) {\n\t\t\tif (!options.waitForStatement) await this.#giveUpSuppliedClient();\n\t\t\treturn;\n\t\t}\n\t\tif (this.#connectFailure !== void 0) {\n\t\t\tthis.directClient.end().catch(() => void 0);\n\t\t\treturn;\n\t\t}\n\t\tconst releaseQueryLock = options.waitForStatement ? await acquireClientQueryLock(this.directClient) : () => {};\n\t\ttry {\n\t\t\tawait this.directClient.end();\n\t\t} finally {\n\t\t\treleaseQueryLock();\n\t\t}\n\t\tthis.#connected = false;\n\t}\n\tasync #giveUpSuppliedClient() {\n\t\tmarkClientAbandoned(this.directClient);\n\t\tawait closeClientStreams(this.directClient).catch(() => void 0);\n\t\tif (this.#txState.unfinishedOnServer) await this.#rollbackUnderQueryLock().catch(() => void 0);\n\t}\n\tasync #rollbackUnderQueryLock() {\n\t\tconst releaseLock = await acquireClientQueryLock(this.directClient);\n\t\ttry {\n\t\t\tawait this.directClient.query(\"ROLLBACK\");\n\t\t} finally {\n\t\t\treleaseLock();\n\t\t}\n\t}\n\tasync acquireClient() {\n\t\tif (this.#connectFailure !== void 0) throw this.#connectFailure;\n\t\tif (this.#closed || hasLostConnection(this.directClient)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection lost or closed. Create a new client to reconnect.\");\n\t\tif (!this.#connected) await this.#connectDirectClient();\n\t\tawait ensureSessionSettings(this.#sessionSettings, this.directClient).catch(rethrowClientError(this.directClient));\n\t\treturn this.directClient;\n\t}\n\tasync #connectDirectClient() {\n\t\tif (this.#connectPromise === void 0) {\n\t\t\tif (hasStartedConnecting(this.directClient)) {\n\t\t\t\tthis.#connected = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#connectPromise = this.#connectClient();\n\t\t}\n\t\tawait this.#connectPromise;\n\t}\n\tasync #connectClient() {\n\t\ttry {\n\t\t\tawait this.directClient.connect();\n\t\t} catch (error) {\n\t\t\tthis.#connectFailure = normalizePgConnectFailure(error);\n\t\t\tthis.#connectPromise = void 0;\n\t\t\tthrow this.#connectFailure;\n\t\t}\n\t\tthis.#connected = true;\n\t}\n\tasync releaseClient(_client) {}\n};\nfunction createBoundDriverFromBinding(binding, cursorOpts, extraOpts) {\n\tconst preparedStatements = extraOpts?.preparedStatements;\n\tconst sessionSettings = extraOpts?.sessionSettings;\n\tswitch (binding.kind) {\n\t\tcase \"url\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: {\n\t\t\t\tpool: suppressIdleConnectionErrors$1(createPgPool({\n\t\t\t\t\tconnectionString: binding.url,\n\t\t\t\t\tconnectionTimeoutMillis: 2e4,\n\t\t\t\t\tidleTimeoutMillis: 3e4\n\t\t\t\t}, sessionSettings ?? {})),\n\t\t\t\townedByDriver: true\n\t\t\t},\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements,\n\t\t\tsessionSettings\n\t\t});\n\t\tcase \"pgPool\": return new PostgresPoolDriverImpl({\n\t\t\tconnect: {\n\t\t\t\tpool: suppressIdleConnectionErrors$1(binding.pool),\n\t\t\t\townedByDriver: binding.ownedByDriver\n\t\t\t},\n\t\t\tcursor: cursorOpts,\n\t\t\tpreparedStatements,\n\t\t\tsessionSettings\n\t\t});\n\t\tcase \"pgClient\":\n\t\t\tif (hasLostConnection(binding.client)) throw driverError(\"DRIVER.NOT_CONNECTED\", \"This pg client lost its connection or was given up by an earlier driver. Create a new client to reconnect.\");\n\t\t\treturn new PostgresDirectDriverImpl({\n\t\t\t\tconnect: {\n\t\t\t\t\tclient: suppressIdleConnectionErrors$1(binding.client),\n\t\t\t\t\townedByDriver: binding.ownedByDriver\n\t\t\t\t},\n\t\t\t\tcursor: cursorOpts,\n\t\t\t\tpreparedStatements,\n\t\t\t\tsessionSettings\n\t\t\t});\n\t}\n}\n/** Ensures the session settings on a client the driver is about to use, holding the client's query lock while it does. */\nasync function ensureSessionSettings(guard, client) {\n\tif (!guard.needs(client)) return;\n\tconst releaseLock = await acquireClientQueryLock(client);\n\ttry {\n\t\tawait guard.ensure(client);\n\t} finally {\n\t\treleaseLock();\n\t}\n}\nfunction readCursor(cursor, size) {\n\treturn callbackToPromise((cb) => {\n\t\tcursor.read(size, (err, rows) => cb(err, rows));\n\t});\n}\nfunction closeCursor(cursor) {\n\treturn callbackToPromise((cb) => cursor.close(cb));\n}\nfunction rethrowClientError(client) {\n\treturn (error) => {\n\t\tthrow normalizePgClientError(client, error);\n\t};\n}\nfunction prepareFailedError(retryError, handle) {\n\tconst cause = retryError instanceof Error ? retryError : new Error(String(retryError));\n\treturn Object.assign(driverError(\"DRIVER.PREPARE_FAILED\", `Prepared statement failed again after re-preparing with a fresh handle: ${cause.message}`, { handle }), { cause });\n}\n//#endregion\n//#region src/exports/runtime.ts\nconst USE_BEFORE_CONNECT_MESSAGE = \"Postgres driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst CLOSED_MESSAGE = \"Postgres driver is closed. Call connect(binding) to reconnect.\";\nconst CONNECTION_LOST_MESSAGE = \"Postgres connection lost or closed. Call connect(binding) to reconnect.\";\nconst ALREADY_CONNECTED_MESSAGE = \"Postgres driver already connected. Call close() before reconnecting with a new binding.\";\nfunction unboundQuery(notConnected) {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow notConnected();\n\t\t} };\n\t} };\n}\nconst notConnectedMessages = {\n\tunbound: USE_BEFORE_CONNECT_MESSAGE,\n\tclosed: CLOSED_MESSAGE,\n\tconnectionLost: CONNECTION_LOST_MESSAGE\n};\nvar PostgresUnboundDriverImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\t#delegate = null;\n\t#disconnectedState = \"unbound\";\n\t#cursorOpts;\n\t#preparedStatements;\n\t#sessionSettings;\n\tconstructor(options) {\n\t\tthis.#cursorOpts = options?.cursor;\n\t\tthis.#preparedStatements = options?.preparedStatements;\n\t\tthis.#sessionSettings = options?.sessionSettings;\n\t}\n\tget state() {\n\t\tif (this.#delegate !== null) return \"connected\";\n\t\treturn this.#disconnectedState === \"unbound\" ? \"unbound\" : \"closed\";\n\t}\n\t#notConnectedError() {\n\t\treturn driverError(\"DRIVER.NOT_CONNECTED\", notConnectedMessages[this.#disconnectedState]);\n\t}\n\t#requireDelegate() {\n\t\tconst delegate = this.#delegate;\n\t\tif (delegate === null) throw this.#notConnectedError();\n\t\treturn delegate;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#delegate !== null) throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#delegate = createBoundDriverFromBinding(binding, this.#cursorOpts, {\n\t\t\tpreparedStatements: this.#preparedStatements,\n\t\t\tsessionSettings: this.#sessionSettings\n\t\t});\n\t\tthis.#disconnectedState = \"unbound\";\n\t}\n\tasync acquireConnection() {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst connection = await delegate.acquireConnection();\n\t\treturn this.#wrapConnection(connection, delegate);\n\t}\n\t/**\n\t* Wraps an acquired connection so that teardown paths which close the\n\t* underlying delegate (notably `destroy()` on a pgClient binding, where\n\t* the single socket means a destroyed connection invalidates the driver)\n\t* also reset our own `#delegate` reference. Without this, a failed\n\t* transaction rollback would leave the outer unbound wrapper reporting\n\t* `connected` while routing subsequent work to an already-ended delegate.\n\t*/\n\t#wrapConnection(connection, delegate) {\n\t\tconst syncDelegateState = () => {\n\t\t\tif (this.#delegate === delegate && delegate.state === \"closed\") {\n\t\t\t\tthis.#delegate = null;\n\t\t\t\tthis.#disconnectedState = \"connectionLost\";\n\t\t\t}\n\t\t};\n\t\tconst wrapped = {\n\t\t\tbeginTransaction: connection.beginTransaction.bind(connection),\n\t\t\tquery: connection.query.bind(connection),\n\t\t\texecute: connection.execute.bind(connection),\n\t\t\trelease: async () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.release();\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t},\n\t\t\tdestroy: async (reason) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait connection.destroy(reason);\n\t\t\t\t} finally {\n\t\t\t\t\tsyncDelegateState();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tif (connection.explain) wrapped.explain = connection.explain.bind(connection);\n\t\treturn wrapped;\n\t}\n\tasync close() {\n\t\tconst delegate = this.#delegate;\n\t\tthis.#delegate = null;\n\t\tthis.#disconnectedState = \"closed\";\n\t\tawait delegate?.close();\n\t}\n\tquery(request) {\n\t\tconst delegate = this.#delegate;\n\t\treturn delegate === null ? unboundQuery(() => this.#notConnectedError()) : delegate.query(request);\n\t}\n\tasync execute(request) {\n\t\treturn this.#requireDelegate().execute(request);\n\t}\n\tasync explain(request) {\n\t\tconst delegate = this.#requireDelegate();\n\t\tconst explain = delegate.explain;\n\t\tif (explain === void 0) throw driverError(\"DRIVER.NOT_CONNECTED\", USE_BEFORE_CONNECT_MESSAGE);\n\t\treturn explain.call(delegate, request);\n\t}\n};\nconst postgresRuntimeDriverDescriptor = {\n\t...postgresDriverDescriptorMeta,\n\tcreate(options, sessionSettings) {\n\t\treturn new PostgresUnboundDriverImpl({\n\t\t\t...options,\n\t\t\t...ifDefined(\"sessionSettings\", sessionSettings)\n\t\t});\n\t}\n};\n//#endregion\nexport { createPgClient, createPgPool, postgresRuntimeDriverDescriptor as default, suppressIdleConnectionErrors };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,MAAM,OAAO;CAC/B,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO,YAAY,KAAK,IAAI,OAAO,OAAO,OAAO;EAChD;EACA,UAAU;EACV,UAAU;CACX,CAAC,IAAI,OAAO,OAAO,OAAO;EACzB;EACA,UAAU;EACV,UAAU;EACV;CACD,CAAC;AACF;AAGA,SAAS,kBAAkB,IAAI;CAC9B,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,IAAI,KAAK,WAAW;GACnB,IAAI,KAAK;IACR,OAAO,GAAG;IACV;GACD;GACA,QAAQ,MAAM;EACf,CAAC;CACF,CAAC;AACF;AAGA,IAAI,oBAAoB;;AAExB,IAAI,cAAc,cAAc,OAAO;CACtC;CACA,YAAY,MAAM;EACjB,MAAM,KAAK,MAAM,CAAC,GAAG,KAAK,MAAM,GAAG,KAAK,MAAM;EAC9C,KAAK,OAAO,KAAK;EACjB,KAAK,SAAS,KAAK;CACpB;CACA,YAAY,YAAY;EACvB,MAAM,OAAO;EACb,MAAM,OAAO;EACb,KAAK,QAAQ;EACb,KAAK,aAAa;EAClB,KAAK,UAAU,MAAM;EACrB,IAAI,C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