@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 CHANGED
@@ -1,110 +1,15 @@
1
- # Treadspace DB
1
+ # @adaptware/eagles-db
2
2
 
3
- A Prisma client package for Treadspace database operations.
3
+ Prisma schema and client for the Treadspace hiring database.
4
4
 
5
- ## Installation
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
- ```bash
8
- npm install treadspace-db
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
- npm run db:push
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