@prisma/adapter-pg 7.6.0-dev.1 → 7.6.0-dev.11
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class PrismaPg implements SqlMigrationAwareDriverAdapterFactory {
|
|
|
39
39
|
readonly adapterName: string;
|
|
40
40
|
private readonly config;
|
|
41
41
|
private externalPool;
|
|
42
|
-
constructor(poolOrConfig: pg.Pool | pg.PoolConfig, options?: PrismaPgOptions | undefined);
|
|
42
|
+
constructor(poolOrConfig: pg.Pool | pg.PoolConfig | string, options?: PrismaPgOptions | undefined);
|
|
43
43
|
connect(): Promise<PrismaPgAdapter>;
|
|
44
44
|
connectToShadowDb(): Promise<PrismaPgAdapter>;
|
|
45
45
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class PrismaPg implements SqlMigrationAwareDriverAdapterFactory {
|
|
|
39
39
|
readonly adapterName: string;
|
|
40
40
|
private readonly config;
|
|
41
41
|
private externalPool;
|
|
42
|
-
constructor(poolOrConfig: pg.Pool | pg.PoolConfig, options?: PrismaPgOptions | undefined);
|
|
42
|
+
constructor(poolOrConfig: pg.Pool | pg.PoolConfig | string, options?: PrismaPgOptions | undefined);
|
|
43
43
|
connect(): Promise<PrismaPgAdapter>;
|
|
44
44
|
connectToShadowDb(): Promise<PrismaPgAdapter>;
|
|
45
45
|
}
|
package/dist/index.js
CHANGED
|
@@ -519,11 +519,13 @@ function mapDriverError(error) {
|
|
|
519
519
|
kind: "TableDoesNotExist",
|
|
520
520
|
table: error.message.split(" ").at(1)?.split('"').at(1)
|
|
521
521
|
};
|
|
522
|
-
case "42703":
|
|
522
|
+
case "42703": {
|
|
523
|
+
const rawColumn = error.message.match(/^column (.+) does not exist$/)?.at(1);
|
|
523
524
|
return {
|
|
524
525
|
kind: "ColumnNotFound",
|
|
525
|
-
column:
|
|
526
|
+
column: rawColumn?.replace(/"((?:""|[^"])*)"/g, (_, id) => id.replaceAll('""', '"'))
|
|
526
527
|
};
|
|
528
|
+
}
|
|
527
529
|
case "42P04":
|
|
528
530
|
return {
|
|
529
531
|
kind: "DatabaseAlreadyExists",
|
|
@@ -781,6 +783,9 @@ var PrismaPgAdapterFactory = class {
|
|
|
781
783
|
if (poolOrConfig instanceof import_pg2.default.Pool) {
|
|
782
784
|
this.externalPool = poolOrConfig;
|
|
783
785
|
this.config = poolOrConfig.options;
|
|
786
|
+
} else if (typeof poolOrConfig === "string") {
|
|
787
|
+
this.externalPool = null;
|
|
788
|
+
this.config = { connectionString: poolOrConfig };
|
|
784
789
|
} else {
|
|
785
790
|
this.externalPool = null;
|
|
786
791
|
this.config = poolOrConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -483,11 +483,13 @@ function mapDriverError(error) {
|
|
|
483
483
|
kind: "TableDoesNotExist",
|
|
484
484
|
table: error.message.split(" ").at(1)?.split('"').at(1)
|
|
485
485
|
};
|
|
486
|
-
case "42703":
|
|
486
|
+
case "42703": {
|
|
487
|
+
const rawColumn = error.message.match(/^column (.+) does not exist$/)?.at(1);
|
|
487
488
|
return {
|
|
488
489
|
kind: "ColumnNotFound",
|
|
489
|
-
column:
|
|
490
|
+
column: rawColumn?.replace(/"((?:""|[^"])*)"/g, (_, id) => id.replaceAll('""', '"'))
|
|
490
491
|
};
|
|
492
|
+
}
|
|
491
493
|
case "42P04":
|
|
492
494
|
return {
|
|
493
495
|
kind: "DatabaseAlreadyExists",
|
|
@@ -745,6 +747,9 @@ var PrismaPgAdapterFactory = class {
|
|
|
745
747
|
if (poolOrConfig instanceof pg2.Pool) {
|
|
746
748
|
this.externalPool = poolOrConfig;
|
|
747
749
|
this.config = poolOrConfig.options;
|
|
750
|
+
} else if (typeof poolOrConfig === "string") {
|
|
751
|
+
this.externalPool = null;
|
|
752
|
+
this.config = { connectionString: poolOrConfig };
|
|
748
753
|
} else {
|
|
749
754
|
this.externalPool = null;
|
|
750
755
|
this.config = poolOrConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/adapter-pg",
|
|
3
|
-
"version": "7.6.0-dev.
|
|
3
|
+
"version": "7.6.0-dev.11",
|
|
4
4
|
"description": "Prisma's driver adapter for \"pg\"",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"pg": "^8.16.3",
|
|
35
35
|
"postgres-array": "3.0.4",
|
|
36
36
|
"@types/pg": "8.11.11",
|
|
37
|
-
"@prisma/driver-adapter-utils": "7.6.0-dev.
|
|
37
|
+
"@prisma/driver-adapter-utils": "7.6.0-dev.11"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@prisma/debug": "7.6.0-dev.
|
|
40
|
+
"@prisma/debug": "7.6.0-dev.11"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "DEV=true tsx helpers/build.ts",
|