Skip to content

Commit 9d8a0bc

Browse files
update readme
1 parent c703e09 commit 9d8a0bc

4 files changed

Lines changed: 12 additions & 60 deletions

File tree

orm/script/README.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,32 +71,21 @@ postgresql://user:password@host:port/database
7171
7272
--- Next steps ---
7373
74-
1. Install the PostgreSQL adapter
75-
This example uses the PostgreSQL driver adapter. If you haven't already installed it, install it in your project:
76-
npm install @prisma/adapter-pg
77-
78-
...and configure it in your Prisma Client instance:
79-
import { PrismaClient } from './prisma/generated/client'
80-
import { PrismaPg } from '@prisma/adapter-pg'
81-
82-
const pool = new PrismaPg({ connectionString: process.env.DATABASE_URL! })
83-
const prisma = new PrismaClient({ adapter: pool })
84-
85-
2. Apply migrations
74+
1. Apply migrations
8675
Run the following command to create and apply a migration:
8776
npx prisma migrate dev
8877
89-
3. Manage your data
78+
2. Manage your data
9079
View and edit your data locally by running this command:
9180
npx prisma studio
9281
9382
...or online in Console:
9483
https://console.prisma.io/{workspaceId}/{projectId}/studio
9584
96-
4. Send queries from your app
85+
3. Send queries from your app
9786
If you already have an existing app with Prisma ORM, you can now run it and it will send queries against your newly created Prisma Postgres instance.
9887
99-
5. Learn more
88+
4. Learn more
10089
For more info, visit the Prisma Postgres docs: https://pris.ly/ppg-docs
10190
```
10291

@@ -232,18 +221,6 @@ Learn more about the different connection configurations in the [docs](https://w
232221

233222
<details><summary>Expand for an overview of example configurations with different databases</summary>
234223

235-
### 2.1. Configure Prisma Client with the adapter
236-
237-
This example uses the PostgreSQL driver adapter. The Prisma Client is configured in [`script.ts`](./script.ts):
238-
239-
```ts
240-
import { PrismaClient } from './prisma/generated/client'
241-
import { PrismaPg } from '@prisma/adapter-pg'
242-
243-
const pool = new PrismaPg({ connectionString: process.env.DATABASE_URL! })
244-
const prisma = new PrismaClient({ adapter: pool })
245-
```
246-
247224
### Your own PostgreSQL database
248225

249226
This example already uses a standard PostgreSQL connection with the `@prisma/adapter-pg` adapter. You can connect to any PostgreSQL database using a standard connection string.

orm/starter/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ Now, open the `.env` file and update the `DATABASE_URL` environment variables wi
5353

5454
```bash
5555
# .env
56-
DATABASE_URL="__YOUR_DATABASE_CONNECTION_STRING__"
56+
DATABASE_URL="postgresql://user:password@host:port/database"
5757
```
5858

59-
Note that `__YOUR_DATABASE_CONNECTION_STRING__` is a placeholder value that you need to replace with the values of your connection string.
60-
6159
### 3. Run a database migration to create the `User` table
6260

6361
The Prisma schema file contains a single `User` model. You can map this model to the database and create the corresponding `User` table using the following command:

orm/testing-express/README.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,32 +71,21 @@ postgresql://user:password@host:port/database
7171
7272
--- Next steps ---
7373
74-
1. Install the PostgreSQL adapter
75-
This example uses the PostgreSQL driver adapter. If you haven't already installed it, install it in your project:
76-
npm install @prisma/adapter-pg
77-
78-
...and configure it in your Prisma Client instance:
79-
import { PrismaClient } from '../prisma/generated/client'
80-
import { PrismaPg } from '@prisma/adapter-pg'
81-
82-
const pool = new PrismaPg({ connectionString: process.env.DATABASE_URL! })
83-
const prisma = new PrismaClient({ adapter: pool })
84-
85-
2. Apply migrations
74+
1. Apply migrations
8675
Run the following command to create and apply a migration:
8776
npx prisma migrate dev
8877
89-
3. Manage your data
78+
2. Manage your data
9079
View and edit your data locally by running this command:
9180
npx prisma studio
9281
9382
...or online in Console:
9483
https://console.prisma.io/{workspaceId}/{projectId}/studio
9584
96-
4. Send queries from your app
85+
3. Send queries from your app
9786
If you already have an existing app with Prisma ORM, you can now run it and it will send queries against your newly created Prisma Postgres instance.
9887
99-
5. Learn more
88+
4. Learn more
10089
For more info, visit the Prisma Postgres docs: https://pris.ly/ppg-docs
10190
```
10291

@@ -171,18 +160,6 @@ Learn more about the different connection configurations in the [docs](https://w
171160

172161
<details><summary>Expand for an overview of example configurations with different databases</summary>
173162

174-
### 2.1. Configure Prisma Client with the adapter
175-
176-
This example uses the PostgreSQL driver adapter. The Prisma Client is configured in [`src/app.ts`](./src/app.ts):
177-
178-
```ts
179-
import { PrismaClient } from '../prisma/generated/client'
180-
import { PrismaPg } from '@prisma/adapter-pg'
181-
182-
const pool = new PrismaPg({ connectionString: process.env.DATABASE_URL! })
183-
const prisma = new PrismaClient({ adapter: pool })
184-
```
185-
186163
### Your own PostgreSQL database
187164

188165
This example already uses a standard PostgreSQL connection with the `@prisma/adapter-pg` adapter. You can connect to any PostgreSQL database using a standard connection string.

orm/typedsql/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ npm install
3737

3838
### 2. Create and seed the database
3939

40-
Run the following command to create your SQLite database file. This also creates the `User` and `Post` tables that are defined in [`prisma/schema.prisma`](./prisma/schema.prisma):
40+
Run the following command to create your SQLite database file. This also creates the `User` and `TrackingEvent` tables that are defined in [`prisma/schema.prisma`](./prisma/schema.prisma):
4141

4242
```
4343
npx prisma migrate dev --name init
@@ -62,7 +62,7 @@ This command runs `prisma generate --sql`, which will generate the Prisma Client
6262
npm run dev
6363
```
6464

65-
This command will run [`index.ts`](./index.ts), which will execute the SQL query defined in [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql) and print the results to the console.
65+
This command will run [`src/index.ts`](./src/index.ts), which will execute the SQL query defined in [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql) and print the results to the console.
6666

6767
## Project Structure
6868

@@ -73,7 +73,7 @@ This example project is structured similarly to the [starter example](https://gi
7373

7474
Key areas to look at:
7575
1. Database schema: [`prisma/schema.prisma`](./prisma/schema.prisma)
76-
2. Example SQL query: [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql)
76+
2. Example SQL queries: [`prisma/sql/`](./prisma/sql/)
7777
3. Query execution: [`src/index.ts`](./src/index.ts)
7878
4. Data seeding: [`prisma/seed.ts`](./prisma/seed.ts)
7979
5. Build and run scripts: [`package.json`](./package.json)

0 commit comments

Comments
 (0)