@prisma/adapter-neon 6.13.0-dev.3 → 6.13.0-dev.31

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 CHANGED
@@ -1,6 +1,50 @@
1
+ import type { ConnectionInfo } from '@prisma/driver-adapter-utils';
2
+ import type { IsolationLevel } from '@prisma/driver-adapter-utils';
1
3
  import * as neon from '@neondatabase/serverless';
2
4
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
3
5
  import type { SqlDriverAdapterFactory } from '@prisma/driver-adapter-utils';
6
+ import type { SqlQuery } from '@prisma/driver-adapter-utils';
7
+ import type { SqlQueryable } from '@prisma/driver-adapter-utils';
8
+ import type { SqlResultSet } from '@prisma/driver-adapter-utils';
9
+ import type { Transaction } from '@prisma/driver-adapter-utils';
10
+
11
+ declare type ARRAY_MODE_ENABLED = true;
12
+
13
+ /**
14
+ * Base class for http client, ws client and ws transaction
15
+ */
16
+ declare abstract class NeonQueryable implements SqlQueryable {
17
+ readonly provider = "postgres";
18
+ readonly adapterName: string;
19
+ /**
20
+ * Execute a query given as SQL, interpolating the given parameters.
21
+ */
22
+ queryRaw(query: SqlQuery): Promise<SqlResultSet>;
23
+ /**
24
+ * Execute a query given as SQL, interpolating the given parameters and
25
+ * returning the number of affected rows.
26
+ * Note: Queryable expects a u64, but napi.rs only supports u32.
27
+ */
28
+ executeRaw(query: SqlQuery): Promise<number>;
29
+ /**
30
+ * Run a query against the database, returning the result set.
31
+ * Should the query fail due to a connection error, the connection is
32
+ * marked as unhealthy.
33
+ */
34
+ abstract performIO(query: SqlQuery): Promise<PerformIOResult>;
35
+ }
36
+
37
+ /**
38
+ * Base class for WS-based queryables: top-level client and transaction
39
+ */
40
+ declare class NeonWsQueryable<ClientT extends neon.Pool | neon.PoolClient> extends NeonQueryable {
41
+ protected client: ClientT;
42
+ constructor(client: ClientT);
43
+ performIO(query: SqlQuery): Promise<PerformIOResult>;
44
+ protected onError(e: any): never;
45
+ }
46
+
47
+ declare type PerformIOResult = neon.QueryResult<any> | neon.FullQueryResults<ARRAY_MODE_ENABLED>;
4
48
 
5
49
  export declare class PrismaNeon implements SqlDriverAdapterFactory {
6
50
  private readonly config;
@@ -8,7 +52,18 @@ export declare class PrismaNeon implements SqlDriverAdapterFactory {
8
52
  readonly provider = "postgres";
9
53
  readonly adapterName: string;
10
54
  constructor(config: neon.PoolConfig, options?: PrismaNeonOptions | undefined);
11
- connect(): Promise<SqlDriverAdapter>;
55
+ connect(): Promise<PrismaNeonAdapter>;
56
+ }
57
+
58
+ declare class PrismaNeonAdapter extends NeonWsQueryable<neon.Pool> implements SqlDriverAdapter {
59
+ private options?;
60
+ private isRunning;
61
+ constructor(pool: neon.Pool, options?: PrismaNeonOptions | undefined);
62
+ executeScript(_script: string): Promise<void>;
63
+ startTransaction(isolationLevel?: IsolationLevel): Promise<Transaction>;
64
+ getConnectionInfo(): ConnectionInfo;
65
+ dispose(): Promise<void>;
66
+ underlyingDriver(): neon.Pool;
12
67
  }
13
68
 
14
69
  export declare class PrismaNeonHTTP implements SqlDriverAdapterFactory {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,50 @@
1
+ import type { ConnectionInfo } from '@prisma/driver-adapter-utils';
2
+ import type { IsolationLevel } from '@prisma/driver-adapter-utils';
1
3
  import * as neon from '@neondatabase/serverless';
2
4
  import type { SqlDriverAdapter } from '@prisma/driver-adapter-utils';
3
5
  import type { SqlDriverAdapterFactory } from '@prisma/driver-adapter-utils';
6
+ import type { SqlQuery } from '@prisma/driver-adapter-utils';
7
+ import type { SqlQueryable } from '@prisma/driver-adapter-utils';
8
+ import type { SqlResultSet } from '@prisma/driver-adapter-utils';
9
+ import type { Transaction } from '@prisma/driver-adapter-utils';
10
+
11
+ declare type ARRAY_MODE_ENABLED = true;
12
+
13
+ /**
14
+ * Base class for http client, ws client and ws transaction
15
+ */
16
+ declare abstract class NeonQueryable implements SqlQueryable {
17
+ readonly provider = "postgres";
18
+ readonly adapterName: string;
19
+ /**
20
+ * Execute a query given as SQL, interpolating the given parameters.
21
+ */
22
+ queryRaw(query: SqlQuery): Promise<SqlResultSet>;
23
+ /**
24
+ * Execute a query given as SQL, interpolating the given parameters and
25
+ * returning the number of affected rows.
26
+ * Note: Queryable expects a u64, but napi.rs only supports u32.
27
+ */
28
+ executeRaw(query: SqlQuery): Promise<number>;
29
+ /**
30
+ * Run a query against the database, returning the result set.
31
+ * Should the query fail due to a connection error, the connection is
32
+ * marked as unhealthy.
33
+ */
34
+ abstract performIO(query: SqlQuery): Promise<PerformIOResult>;
35
+ }
36
+
37
+ /**
38
+ * Base class for WS-based queryables: top-level client and transaction
39
+ */
40
+ declare class NeonWsQueryable<ClientT extends neon.Pool | neon.PoolClient> extends NeonQueryable {
41
+ protected client: ClientT;
42
+ constructor(client: ClientT);
43
+ performIO(query: SqlQuery): Promise<PerformIOResult>;
44
+ protected onError(e: any): never;
45
+ }
46
+
47
+ declare type PerformIOResult = neon.QueryResult<any> | neon.FullQueryResults<ARRAY_MODE_ENABLED>;
4
48
 
5
49
  export declare class PrismaNeon implements SqlDriverAdapterFactory {
6
50
  private readonly config;
@@ -8,7 +52,18 @@ export declare class PrismaNeon implements SqlDriverAdapterFactory {
8
52
  readonly provider = "postgres";
9
53
  readonly adapterName: string;
10
54
  constructor(config: neon.PoolConfig, options?: PrismaNeonOptions | undefined);
11
- connect(): Promise<SqlDriverAdapter>;
55
+ connect(): Promise<PrismaNeonAdapter>;
56
+ }
57
+
58
+ declare class PrismaNeonAdapter extends NeonWsQueryable<neon.Pool> implements SqlDriverAdapter {
59
+ private options?;
60
+ private isRunning;
61
+ constructor(pool: neon.Pool, options?: PrismaNeonOptions | undefined);
62
+ executeScript(_script: string): Promise<void>;
63
+ startTransaction(isolationLevel?: IsolationLevel): Promise<Transaction>;
64
+ getConnectionInfo(): ConnectionInfo;
65
+ dispose(): Promise<void>;
66
+ underlyingDriver(): neon.Pool;
12
67
  }
13
68
 
14
69
  export declare class PrismaNeonHTTP implements SqlDriverAdapterFactory {
package/dist/index.js CHANGED
@@ -611,6 +611,9 @@ var PrismaNeonAdapter = class extends NeonWsQueryable {
611
611
  this.isRunning = false;
612
612
  }
613
613
  }
614
+ underlyingDriver() {
615
+ return this.client;
616
+ }
614
617
  };
615
618
  var PrismaNeonAdapterFactory = class {
616
619
  constructor(config, options) {
package/dist/index.mjs CHANGED
@@ -574,6 +574,9 @@ var PrismaNeonAdapter = class extends NeonWsQueryable {
574
574
  this.isRunning = false;
575
575
  }
576
576
  }
577
+ underlyingDriver() {
578
+ return this.client;
579
+ }
577
580
  };
578
581
  var PrismaNeonAdapterFactory = class {
579
582
  constructor(config, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-neon",
3
- "version": "6.13.0-dev.3",
3
+ "version": "6.13.0-dev.31",
4
4
  "description": "Prisma's driver adapter for \"@neondatabase/serverless\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "postgres-array": "3.0.4",
35
35
  "@neondatabase/serverless": ">0.6.0 <2",
36
- "@prisma/driver-adapter-utils": "6.13.0-dev.3"
36
+ "@prisma/driver-adapter-utils": "6.13.0-dev.31"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@swc/core": "1.11.5",