@a_team/prisma 3.0.20-macos → 3.0.22-linux
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/README.md +58 -0
- package/dist/client/default.d.ts +1 -0
- package/dist/client/default.js +1 -0
- package/dist/client/edge.d.ts +1 -0
- package/dist/client/edge.js +400 -0
- package/dist/client/index-browser.js +390 -0
- package/dist/client/index.d.ts +26220 -0
- package/dist/client/index.js +421 -0
- package/dist/client/libquery_engine-linux-musl-openssl-3.0.x.so.node +0 -0
- package/dist/client/package.json +84 -0
- package/dist/client/runtime/edge-esm.js +31 -0
- package/dist/client/runtime/edge.js +31 -0
- package/dist/client/runtime/index-browser.d.ts +365 -0
- package/dist/client/runtime/index-browser.js +13 -0
- package/dist/client/runtime/library.d.ts +3273 -0
- package/dist/client/runtime/library.js +143 -0
- package/dist/client/runtime/react-native.js +80 -0
- package/dist/client/runtime/wasm.js +32 -0
- package/dist/client/schema.prisma +540 -0
- package/dist/client/wasm.d.ts +1 -0
- package/dist/client/wasm.js +390 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +33 -0
- package/package.json +3 -5
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @a_team/prisma
|
|
2
|
+
|
|
3
|
+
This package contains a shared Prisma schema, organized into [multiple files](https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support), to be used across multiple projects. By centralizing the schema definitions, we ensure consistency and reduce duplication of effort:
|
|
4
|
+
|
|
5
|
+
1. **Consistency**: We are targeting the same MongoDB database. If we use different schema definition files, there's a risk of having inconsistent model definitions, which could lead to conflicts and data overrides.
|
|
6
|
+
1. **Efficiency**: A single schema definition can reduce redundant work. Currently, the schema file has over 300 lines, and this could easily grow to 1000+ lines as we onboard more collections. By working collaboratively on a single schema definition, we can streamline our efforts and improve the overall quality.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
To install this package, use the following command:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
yarn add @a_team/prisma
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
To use the shared Prisma client:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { PrismaClient } from "@prisma/client";
|
|
22
|
+
|
|
23
|
+
const prisma = new PrismaClient();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Playground
|
|
27
|
+
|
|
28
|
+
The playground is a dedicated space where you can test and experiment with the Prisma client and schema. It contains various scripts that demonstrate how to interact with your database models.
|
|
29
|
+
|
|
30
|
+
Before running any playground scripts, make sure to set up your environment variables. First, copy the `.env.sample` file to `.env`:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
cp .env.sample .env
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then, fill in the required environment variables in the `.env` file.
|
|
37
|
+
|
|
38
|
+
To run a playground script, use the following command:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npx ts-node playground/missionSpec.ts
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Publishing
|
|
45
|
+
|
|
46
|
+
To publish updates to this package, use the following command:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
yarn build && yarn publish
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Additional Information
|
|
53
|
+
|
|
54
|
+
The package is available on npm at: [@a_team/prisma](https://www.npmjs.com/package/@a_team/prisma).
|
|
55
|
+
|
|
56
|
+
### Reference
|
|
57
|
+
|
|
58
|
+
[Sharing Prisma Between Multiple Applications](https://medium.com/@nolawnchairs/sharing-prisma-between-multiple-applications-5c7a7d131519)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { ...require('.') }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './default'
|