@adaptware/eagles-db 0.4.17 → 0.4.19
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 +9 -104
- package/client/edge.js +103 -5
- package/client/index-browser.js +98 -0
- package/client/index.d.ts +19360 -5843
- package/client/index.js +103 -5
- package/client/libquery_engine-darwin.dylib.node +0 -0
- package/client/package.json +1 -1
- package/client/schema.prisma +240 -75
- package/client/wasm.js +98 -0
- package/package.json +1 -1
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/.DS_Store +0 -0
- package/prisma/schema/applications.prisma +39 -36
- package/prisma/schema/assignment.prisma +6 -0
- package/prisma/schema/document.prisma +37 -0
- package/prisma/schema/interview.prisma +3 -0
- package/prisma/schema/jobApplicationFields.prisma +37 -0
- package/prisma/schema/jobApplicationResponse.prisma +33 -0
- package/prisma/schema/jobApplicationTemplate.prisma +30 -0
- package/prisma/schema/jobDescription.prisma +15 -11
- package/prisma/schema/migrations/20260519120000_add_analytics_schema/migration.sql +84 -0
- package/prisma/schema/organisation.prisma +30 -27
- package/prisma/schema/resume.prisma +5 -1
- package/prisma/schema/user.prisma +1 -0
- package/prisma/schema/migrations/20260610100000_add_communication/migration.sql +0 -131
- package/prisma/schema/migrations/20260610170000_add_communication_application_scope/migration.sql +0 -45
package/README.md
CHANGED
|
@@ -1,110 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @adaptware/eagles-db
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Prisma schema and client for the Treadspace hiring database.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Package name:** `@adaptware/eagles-db`
|
|
6
|
+
**CLI binary:** `treadspace-db` (see [docs/eagles-db/cli-reference.md](./docs/eagles-db/cli-reference.md))
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
### Basic Usage
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import { prisma } from "treadspace-db";
|
|
17
|
-
|
|
18
|
-
// Use the prisma client
|
|
19
|
-
const users = await prisma.user.findMany();
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### With TypeScript
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { prisma, PrismaClient } from "treadspace-db";
|
|
26
|
-
|
|
27
|
-
// The prisma instance is already configured and ready to use
|
|
28
|
-
const user = await prisma.user.create({
|
|
29
|
-
data: {
|
|
30
|
-
email: "user@example.com",
|
|
31
|
-
name: "John Doe",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Environment Setup
|
|
37
|
-
|
|
38
|
-
Make sure to set your `DATABASE_URL` environment variable:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
DATABASE_URL="postgresql://username:password@localhost:5432/database_name"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Development
|
|
45
|
-
|
|
46
|
-
### Prerequisites
|
|
47
|
-
|
|
48
|
-
- Node.js 16+
|
|
49
|
-
- PostgreSQL database
|
|
50
|
-
|
|
51
|
-
### Setup
|
|
52
|
-
|
|
53
|
-
1. Install dependencies:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npm install
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
2. Set up your database URL in `.env`:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
DATABASE_URL="postgresql://username:password@localhost:5432/database_name"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
3. Add your database models to `prisma/schema.prisma`
|
|
66
|
-
|
|
67
|
-
4. Generate Prisma client:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npm run generate
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
5. Push schema to database:
|
|
8
|
+
**Local documentation:** [docs/README.md](./docs/README.md)
|
|
9
|
+
**Central monorepo hub:** [docs/README.md](../docs/README.md)
|
|
74
10
|
|
|
75
11
|
```bash
|
|
76
|
-
|
|
12
|
+
yarn install
|
|
13
|
+
export DATABASE_URL=postgresql://...
|
|
14
|
+
yarn generate
|
|
77
15
|
```
|
|
78
|
-
|
|
79
|
-
### Available Scripts
|
|
80
|
-
|
|
81
|
-
- `npm run build` - Build the TypeScript code
|
|
82
|
-
- `npm run dev` - Watch mode for development
|
|
83
|
-
- `npm run generate` - Generate Prisma client
|
|
84
|
-
- `npm run db:push` - Push schema changes to database
|
|
85
|
-
- `npm run db:migrate` - Create and apply migrations
|
|
86
|
-
- `npm run db:studio` - Open Prisma Studio
|
|
87
|
-
|
|
88
|
-
## Adding Tables
|
|
89
|
-
|
|
90
|
-
To add tables to your database:
|
|
91
|
-
|
|
92
|
-
1. Edit `prisma/schema.prisma` and add your models
|
|
93
|
-
2. Run `npm run generate` to update the Prisma client
|
|
94
|
-
3. Run `npm run db:push` to apply changes to your database
|
|
95
|
-
|
|
96
|
-
Example model:
|
|
97
|
-
|
|
98
|
-
```prisma
|
|
99
|
-
model User {
|
|
100
|
-
id Int @id @default(autoincrement())
|
|
101
|
-
email String @unique
|
|
102
|
-
name String?
|
|
103
|
-
createdAt DateTime @default(now())
|
|
104
|
-
updatedAt DateTime @updatedAt
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## License
|
|
109
|
-
|
|
110
|
-
MIT
|