@a_team/prisma 2.0.1 → 2.0.3

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) => Promise<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 CHANGED
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.PrismaClient = exports.disconnect = exports.connect = void 0;
18
18
  const client_1 = require("@prisma/client");
19
19
  let prisma = null;
20
- const connect = (connectionString) => {
20
+ const connect = async (connectionString) => {
21
21
  if (!prisma) {
22
22
  prisma = new client_1.PrismaClient({
23
23
  datasources: {
@@ -25,6 +25,7 @@ const connect = (connectionString) => {
25
25
  }
26
26
  });
27
27
  }
28
+ await prisma.$connect();
28
29
  return prisma;
29
30
  };
30
31
  exports.connect = connect;
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@a_team/prisma",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "keywords": [],
5
5
  "scripts": {
6
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",
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // npx ts-node playground/contract.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const client_1 = require("@prisma/client");
5
- const prisma = new client_1.PrismaClient();
6
- async function main() {
7
- const contract = await prisma.contract.findUnique({
8
- where: { sid: "66cf64d100e0d700127facdf" },
9
- include: {
10
- mission: true,
11
- },
12
- });
13
- console.log(contract);
14
- }
15
- main()
16
- .then(async () => {
17
- await prisma.$disconnect();
18
- })
19
- .catch(async (e) => {
20
- console.error(e);
21
- await prisma.$disconnect();
22
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // npx ts-node playground/contracts.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const client_1 = require("@prisma/client");
5
- const prisma = new client_1.PrismaClient();
6
- async function main() {
7
- const contracts = await prisma.contract.findMany({
8
- take: 5,
9
- });
10
- console.log(contracts);
11
- }
12
- main()
13
- .then(async () => {
14
- await prisma.$disconnect();
15
- })
16
- .catch(async (e) => {
17
- console.error(e);
18
- await prisma.$disconnect();
19
- });
@@ -1,26 +0,0 @@
1
- "use strict";
2
- // npx ts-node playground/missionSpec.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const client_1 = require("@prisma/client");
5
- const prisma = new client_1.PrismaClient();
6
- async function main() {
7
- const missionSpec = await prisma.missionSpec.findUnique({
8
- where: { id: "66b3856aa504b6860c86f3ac" },
9
- select: {
10
- account: {
11
- select: {
12
- company: true,
13
- },
14
- },
15
- },
16
- });
17
- console.log(missionSpec);
18
- }
19
- main()
20
- .then(async () => {
21
- await prisma.$disconnect();
22
- })
23
- .catch(async (e) => {
24
- console.error(e);
25
- await prisma.$disconnect();
26
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
- // npx ts-node playground/missionSpecs.ts
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const client_1 = require("@prisma/client");
5
- const prisma = new client_1.PrismaClient();
6
- async function main() {
7
- const missionSpec = await prisma.missionSpec.findMany({
8
- take: 5,
9
- });
10
- console.log(missionSpec);
11
- }
12
- main()
13
- .then(async () => {
14
- await prisma.$disconnect();
15
- })
16
- .catch(async (e) => {
17
- console.error(e);
18
- await prisma.$disconnect();
19
- });