@prisma/adapter-pg 5.20.0-dev.12 → 5.20.0-dev.14
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -8
- package/dist/index.mjs +17 -8
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Query } from '@prisma/driver-adapter-utils';
|
|
|
5
5
|
import type { Queryable } from '@prisma/driver-adapter-utils';
|
|
6
6
|
import type { Result } from '@prisma/driver-adapter-utils';
|
|
7
7
|
import type { ResultSet } from '@prisma/driver-adapter-utils';
|
|
8
|
-
import type {
|
|
8
|
+
import type { TransactionContext } from '@prisma/driver-adapter-utils';
|
|
9
9
|
|
|
10
10
|
declare class PgQueryable<ClientT extends StdClient | TransactionClient> implements Queryable {
|
|
11
11
|
protected readonly client: ClientT;
|
|
@@ -34,7 +34,7 @@ export declare class PrismaPg extends PgQueryable<StdClient> implements DriverAd
|
|
|
34
34
|
private options?;
|
|
35
35
|
constructor(client: pg.Pool, options?: PrismaPgOptions | undefined);
|
|
36
36
|
getConnectionInfo(): Result<ConnectionInfo>;
|
|
37
|
-
|
|
37
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
declare type PrismaPgOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { Query } from '@prisma/driver-adapter-utils';
|
|
|
5
5
|
import type { Queryable } from '@prisma/driver-adapter-utils';
|
|
6
6
|
import type { Result } from '@prisma/driver-adapter-utils';
|
|
7
7
|
import type { ResultSet } from '@prisma/driver-adapter-utils';
|
|
8
|
-
import type {
|
|
8
|
+
import type { TransactionContext } from '@prisma/driver-adapter-utils';
|
|
9
9
|
|
|
10
10
|
declare class PgQueryable<ClientT extends StdClient | TransactionClient> implements Queryable {
|
|
11
11
|
protected readonly client: ClientT;
|
|
@@ -34,7 +34,7 @@ export declare class PrismaPg extends PgQueryable<StdClient> implements DriverAd
|
|
|
34
34
|
private options?;
|
|
35
35
|
constructor(client: pg.Pool, options?: PrismaPgOptions | undefined);
|
|
36
36
|
getConnectionInfo(): Result<ConnectionInfo>;
|
|
37
|
-
|
|
37
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
declare type PrismaPgOptions = {
|
package/dist/index.js
CHANGED
|
@@ -488,6 +488,20 @@ var PgTransaction = class extends PgQueryable {
|
|
|
488
488
|
return (0, import_driver_adapter_utils2.ok)(void 0);
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
|
+
var PgTransactionContext = class extends PgQueryable {
|
|
492
|
+
constructor(conn) {
|
|
493
|
+
super(conn);
|
|
494
|
+
this.conn = conn;
|
|
495
|
+
}
|
|
496
|
+
async startTransaction() {
|
|
497
|
+
const options = {
|
|
498
|
+
usePhantomQuery: false
|
|
499
|
+
};
|
|
500
|
+
const tag = "[js::startTransaction]";
|
|
501
|
+
debug("%s options: %O", tag, options);
|
|
502
|
+
return (0, import_driver_adapter_utils2.ok)(new PgTransaction(this.conn, options));
|
|
503
|
+
}
|
|
504
|
+
};
|
|
491
505
|
var PrismaPg = class extends PgQueryable {
|
|
492
506
|
constructor(client, options) {
|
|
493
507
|
if (!(client instanceof import_pg2.default.Pool)) {
|
|
@@ -505,14 +519,9 @@ const adapter = new PrismaPg(pool)
|
|
|
505
519
|
schemaName: this.options?.schema
|
|
506
520
|
});
|
|
507
521
|
}
|
|
508
|
-
async
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
};
|
|
512
|
-
const tag = "[js::startTransaction]";
|
|
513
|
-
debug(`${tag} options: %O`, options);
|
|
514
|
-
const connection = await this.client.connect();
|
|
515
|
-
return (0, import_driver_adapter_utils2.ok)(new PgTransaction(connection, options));
|
|
522
|
+
async transactionContext() {
|
|
523
|
+
const conn = await this.client.connect();
|
|
524
|
+
return (0, import_driver_adapter_utils2.ok)(new PgTransactionContext(conn));
|
|
516
525
|
}
|
|
517
526
|
};
|
|
518
527
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -452,6 +452,20 @@ var PgTransaction = class extends PgQueryable {
|
|
|
452
452
|
return ok(void 0);
|
|
453
453
|
}
|
|
454
454
|
};
|
|
455
|
+
var PgTransactionContext = class extends PgQueryable {
|
|
456
|
+
constructor(conn) {
|
|
457
|
+
super(conn);
|
|
458
|
+
this.conn = conn;
|
|
459
|
+
}
|
|
460
|
+
async startTransaction() {
|
|
461
|
+
const options = {
|
|
462
|
+
usePhantomQuery: false
|
|
463
|
+
};
|
|
464
|
+
const tag = "[js::startTransaction]";
|
|
465
|
+
debug("%s options: %O", tag, options);
|
|
466
|
+
return ok(new PgTransaction(this.conn, options));
|
|
467
|
+
}
|
|
468
|
+
};
|
|
455
469
|
var PrismaPg = class extends PgQueryable {
|
|
456
470
|
constructor(client, options) {
|
|
457
471
|
if (!(client instanceof pg2.Pool)) {
|
|
@@ -469,14 +483,9 @@ const adapter = new PrismaPg(pool)
|
|
|
469
483
|
schemaName: this.options?.schema
|
|
470
484
|
});
|
|
471
485
|
}
|
|
472
|
-
async
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
};
|
|
476
|
-
const tag = "[js::startTransaction]";
|
|
477
|
-
debug(`${tag} options: %O`, options);
|
|
478
|
-
const connection = await this.client.connect();
|
|
479
|
-
return ok(new PgTransaction(connection, options));
|
|
486
|
+
async transactionContext() {
|
|
487
|
+
const conn = await this.client.connect();
|
|
488
|
+
return ok(new PgTransactionContext(conn));
|
|
480
489
|
}
|
|
481
490
|
};
|
|
482
491
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-pg",
|
|
3
|
-
"version": "5.20.0-dev.
|
|
3
|
+
"version": "5.20.0-dev.14",
|
|
4
4
|
"description": "Prisma's driver adapter for \"pg\"",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"postgres-array": "3.0.2",
|
|
35
|
-
"@prisma/driver-adapter-utils": "5.20.0-dev.
|
|
35
|
+
"@prisma/driver-adapter-utils": "5.20.0-dev.14"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@swc/core": "1.6.13",
|