You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/d1/tutorials/d1-and-prisma-orm/index.mdx
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,22 @@ To learn more about Prisma ORM, refer to the [Prisma documentation](https://www.
23
23
24
24
This tutorial shows you how to set up and deploy a Cloudflare Worker that is accessing a D1 database from scratch.
25
25
26
+
## Quick start
26
27
28
+
If you want to skip the steps and get started quickly, click on the button below.
27
29
28
-
### Prerequisites
30
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/docs-examples/tree/d1-prisma/d1/query-d1-using-prisma)
31
+
32
+
This creates a repository in your GitHub account and deploys the application to Cloudflare Workers. Use this option if you are familiar with Cloudflare Workers, and wish to skip the step-by-step guidance.
33
+
34
+
You may wish to manually follow the steps if you are new to Cloudflare Workers.
35
+
36
+
## Prerequisites
29
37
30
38
-[`Node.js`](https://nodejs.org/en/) and [`npm`](https://docs.npmjs.com/getting-started) installed on your machine.
31
39
- A [Cloudflare account](https://dash.cloudflare.com).
32
40
33
-
###1. Create a Cloudflare Worker
41
+
## 1. Create a Cloudflare Worker
34
42
35
43
Open your terminal, and run the following command to create a Cloudflare Worker using Cloudflare's [`hello-world`](https://github.com/cloudflare/workers-sdk/tree/4fdd8987772d914cf50725e9fa8cb91a82a6870d/packages/create-cloudflare/templates/hello-world) template:
36
44
@@ -43,7 +51,7 @@ In your terminal, you will be asked a series of questions related your project:
43
51
1. Answer `yes` to using TypeScript.
44
52
2. Answer `no` to deploying your Worker.
45
53
46
-
###2. Initialize Prisma ORM
54
+
## 2. Initialize Prisma ORM
47
55
48
56
:::note
49
57
@@ -93,7 +101,7 @@ generator client {
93
101
Do not specify an `output` destination in the `generator client` block. Instead, allow prisma to generate the files in the default output path.
94
102
:::
95
103
96
-
###3. Create your D1 database
104
+
## 3. Create your D1 database
97
105
98
106
In this step, you will set up your D1 database. You can create a D1 database via the [Cloudflare dashboard](https://dash.cloudflare.com), or via `wrangler`. This tutorial will use the `wrangler` CLI.
99
107
@@ -144,7 +152,7 @@ Replace `<D1_DATABASE_ID>` with the database ID of your D1 instance. If you were
144
152
145
153
Next, you will create a database table in the database to send queries to D1 using Prisma ORM.
146
154
147
-
###4. Create a table in the database
155
+
## 4. Create a table in the database
148
156
149
157
[Prisma Migrate](https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/overview) does not support D1 yet, so you cannot follow the default migration workflows using `prisma migrate dev` or `prisma db push`.
0 commit comments