@prisma/adapter-neon 5.20.0-dev.2 → 5.20.0-dev.21
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -9
- package/dist/index.mjs +18 -9
- 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 type ARRAY_MODE_ENABLED = true;
|
|
11
11
|
|
|
@@ -49,7 +49,7 @@ export declare class PrismaNeon extends NeonWsQueryable<neon.Pool> implements Dr
|
|
|
49
49
|
private isRunning;
|
|
50
50
|
constructor(pool: neon.Pool, options?: PrismaNeonOptions | undefined);
|
|
51
51
|
getConnectionInfo(): Result<ConnectionInfo>;
|
|
52
|
-
|
|
52
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
53
53
|
close(): Promise<Result<undefined>>;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ export declare class PrismaNeonHTTP extends NeonQueryable implements DriverAdapt
|
|
|
57
57
|
private client;
|
|
58
58
|
constructor(client: neon.NeonQueryFunction<any, any>);
|
|
59
59
|
performIO(query: Query): Promise<Result<PerformIOResult>>;
|
|
60
|
-
|
|
60
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
declare type PrismaNeonOptions = {
|
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 type ARRAY_MODE_ENABLED = true;
|
|
11
11
|
|
|
@@ -49,7 +49,7 @@ export declare class PrismaNeon extends NeonWsQueryable<neon.Pool> implements Dr
|
|
|
49
49
|
private isRunning;
|
|
50
50
|
constructor(pool: neon.Pool, options?: PrismaNeonOptions | undefined);
|
|
51
51
|
getConnectionInfo(): Result<ConnectionInfo>;
|
|
52
|
-
|
|
52
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
53
53
|
close(): Promise<Result<undefined>>;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ export declare class PrismaNeonHTTP extends NeonQueryable implements DriverAdapt
|
|
|
57
57
|
private client;
|
|
58
58
|
constructor(client: neon.NeonQueryFunction<any, any>);
|
|
59
59
|
performIO(query: Query): Promise<Result<PerformIOResult>>;
|
|
60
|
-
|
|
60
|
+
transactionContext(): Promise<Result<TransactionContext>>;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
declare type PrismaNeonOptions = {
|
package/dist/index.js
CHANGED
|
@@ -486,6 +486,20 @@ var NeonTransaction = class extends NeonWsQueryable {
|
|
|
486
486
|
return Promise.resolve((0, import_driver_adapter_utils2.ok)(void 0));
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
|
+
var NeonTransactionContext = class extends NeonWsQueryable {
|
|
490
|
+
constructor(conn) {
|
|
491
|
+
super(conn);
|
|
492
|
+
this.conn = conn;
|
|
493
|
+
}
|
|
494
|
+
async startTransaction() {
|
|
495
|
+
const options = {
|
|
496
|
+
usePhantomQuery: false
|
|
497
|
+
};
|
|
498
|
+
const tag = "[js::startTransaction]";
|
|
499
|
+
debug("%s options: %O", tag, options);
|
|
500
|
+
return (0, import_driver_adapter_utils2.ok)(new NeonTransaction(this.conn, options));
|
|
501
|
+
}
|
|
502
|
+
};
|
|
489
503
|
var PrismaNeon = class extends NeonWsQueryable {
|
|
490
504
|
constructor(pool, options) {
|
|
491
505
|
if (!(pool instanceof neon.Pool)) {
|
|
@@ -504,14 +518,9 @@ const adapter = new PrismaNeon(pool)
|
|
|
504
518
|
schemaName: this.options?.schema
|
|
505
519
|
});
|
|
506
520
|
}
|
|
507
|
-
async
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
};
|
|
511
|
-
const tag = "[js::startTransaction]";
|
|
512
|
-
debug(`${tag} options: %O`, options);
|
|
513
|
-
const connection = await this.client.connect();
|
|
514
|
-
return (0, import_driver_adapter_utils2.ok)(new NeonTransaction(connection, options));
|
|
521
|
+
async transactionContext() {
|
|
522
|
+
const conn = await this.client.connect();
|
|
523
|
+
return (0, import_driver_adapter_utils2.ok)(new NeonTransactionContext(conn));
|
|
515
524
|
}
|
|
516
525
|
async close() {
|
|
517
526
|
if (this.isRunning) {
|
|
@@ -535,7 +544,7 @@ var PrismaNeonHTTP = class extends NeonQueryable {
|
|
|
535
544
|
})
|
|
536
545
|
);
|
|
537
546
|
}
|
|
538
|
-
|
|
547
|
+
transactionContext() {
|
|
539
548
|
return Promise.reject(new Error("Transactions are not supported in HTTP mode"));
|
|
540
549
|
}
|
|
541
550
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -449,6 +449,20 @@ var NeonTransaction = class extends NeonWsQueryable {
|
|
|
449
449
|
return Promise.resolve(ok(void 0));
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
|
+
var NeonTransactionContext = class extends NeonWsQueryable {
|
|
453
|
+
constructor(conn) {
|
|
454
|
+
super(conn);
|
|
455
|
+
this.conn = conn;
|
|
456
|
+
}
|
|
457
|
+
async startTransaction() {
|
|
458
|
+
const options = {
|
|
459
|
+
usePhantomQuery: false
|
|
460
|
+
};
|
|
461
|
+
const tag = "[js::startTransaction]";
|
|
462
|
+
debug("%s options: %O", tag, options);
|
|
463
|
+
return ok(new NeonTransaction(this.conn, options));
|
|
464
|
+
}
|
|
465
|
+
};
|
|
452
466
|
var PrismaNeon = class extends NeonWsQueryable {
|
|
453
467
|
constructor(pool, options) {
|
|
454
468
|
if (!(pool instanceof neon.Pool)) {
|
|
@@ -467,14 +481,9 @@ const adapter = new PrismaNeon(pool)
|
|
|
467
481
|
schemaName: this.options?.schema
|
|
468
482
|
});
|
|
469
483
|
}
|
|
470
|
-
async
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
};
|
|
474
|
-
const tag = "[js::startTransaction]";
|
|
475
|
-
debug(`${tag} options: %O`, options);
|
|
476
|
-
const connection = await this.client.connect();
|
|
477
|
-
return ok(new NeonTransaction(connection, options));
|
|
484
|
+
async transactionContext() {
|
|
485
|
+
const conn = await this.client.connect();
|
|
486
|
+
return ok(new NeonTransactionContext(conn));
|
|
478
487
|
}
|
|
479
488
|
async close() {
|
|
480
489
|
if (this.isRunning) {
|
|
@@ -498,7 +507,7 @@ var PrismaNeonHTTP = class extends NeonQueryable {
|
|
|
498
507
|
})
|
|
499
508
|
);
|
|
500
509
|
}
|
|
501
|
-
|
|
510
|
+
transactionContext() {
|
|
502
511
|
return Promise.reject(new Error("Transactions are not supported in HTTP mode"));
|
|
503
512
|
}
|
|
504
513
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-neon",
|
|
3
|
-
"version": "5.20.0-dev.
|
|
3
|
+
"version": "5.20.0-dev.21",
|
|
4
4
|
"description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
|
|
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.21"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@neondatabase/serverless": "0.9.3",
|