@a_team/prisma 2.0.0 → 2.0.2

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.
@@ -0,0 +1,5 @@
1
+ import { PrismaClient } from '@prisma/client';
2
+ export declare const connect: (connectionString: string) => PrismaClient<import(".prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
3
+ export declare const disconnect: () => Promise<void>;
4
+ export * from './models';
5
+ export { PrismaClient } from '@prisma/client';
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.PrismaClient = exports.disconnect = exports.connect = void 0;
18
+ const client_1 = require("@prisma/client");
19
+ let prisma = null;
20
+ const connect = (connectionString) => {
21
+ if (!prisma) {
22
+ prisma = new client_1.PrismaClient({
23
+ datasources: {
24
+ db: { url: connectionString }
25
+ }
26
+ });
27
+ }
28
+ return prisma;
29
+ };
30
+ exports.connect = connect;
31
+ const disconnect = async () => {
32
+ if (prisma) {
33
+ await prisma.$disconnect();
34
+ prisma = null;
35
+ }
36
+ };
37
+ exports.disconnect = disconnect;
38
+ __exportStar(require("./models"), exports);
39
+ var client_2 = require("@prisma/client");
40
+ Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return client_2.PrismaClient; } });
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@a_team/prisma",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "keywords": [],
5
5
  "scripts": {
6
- "build": "tsc",
6
+ "build": "rm -rf ./dist & tsc",
7
7
  "generate": "npx prisma generate",
8
- "format": "npx prisma format",
9
- "postinstall": "npx prisma generate"
8
+ "format": "npx prisma format"
10
9
  },
11
10
  "repository": {
12
11
  "type": "git",
@@ -16,11 +15,9 @@
16
15
  "license": "ISC",
17
16
  "main": "dist/index.js",
18
17
  "types": "dist/index.d.ts",
19
- "exports": {
20
- ".": "./dist/index.js"
21
- },
22
18
  "files": [
23
- "dist"
19
+ "dist/index.js",
20
+ "dist/index.d.ts"
24
21
  ],
25
22
  "devDependencies": {
26
23
  "@prisma/client": "^5.17.0",