@a_team/prisma 2.0.5 → 2.0.7
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.ts +7 -4
- package/dist/index.js +13 -21
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { PrismaClient } from '@prisma/client';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
1
|
+
import { PrismaClient as BasePrismaClient } from '@prisma/client';
|
|
2
|
+
export declare class PrismaClient extends BasePrismaClient {
|
|
3
|
+
private readonly url;
|
|
4
|
+
constructor(url: string);
|
|
5
|
+
connect(): Promise<void>;
|
|
6
|
+
disconnect(): Promise<void>;
|
|
7
|
+
}
|
|
4
8
|
export * from './models';
|
|
5
|
-
export { PrismaClient } from '@prisma/client';
|
package/dist/index.js
CHANGED
|
@@ -14,28 +14,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PrismaClient =
|
|
17
|
+
exports.PrismaClient = void 0;
|
|
18
18
|
const client_1 = require("@prisma/client");
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
datasources: {
|
|
24
|
-
db: { url: connectionString }
|
|
25
|
-
}
|
|
26
|
-
});
|
|
19
|
+
class PrismaClient extends client_1.PrismaClient {
|
|
20
|
+
constructor(url) {
|
|
21
|
+
super();
|
|
22
|
+
this.url = url;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.connect = connect;
|
|
32
|
-
const disconnect = async () => {
|
|
33
|
-
if (prisma) {
|
|
34
|
-
await prisma.$disconnect();
|
|
35
|
-
prisma = null;
|
|
24
|
+
async connect() {
|
|
25
|
+
process.env.DATABASE_URL = this.url;
|
|
26
|
+
await this.$connect();
|
|
36
27
|
}
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
async disconnect() {
|
|
29
|
+
await this.$disconnect();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.PrismaClient = PrismaClient;
|
|
39
33
|
__exportStar(require("./models"), exports);
|
|
40
|
-
var client_2 = require("@prisma/client");
|
|
41
|
-
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return client_2.PrismaClient; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a_team/prisma",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rm -rf ./dist & npm run generate & tsc",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@prisma/client": "^5.17.0",
|
|
26
|
+
"@types/node": "^22.8.5",
|
|
26
27
|
"prisma": "^5.17.0",
|
|
27
28
|
"ts-node": "^10.9.2",
|
|
28
29
|
"typescript": "^5.5.4"
|