Skip to content

Commit

Permalink
chore(d1): README fixes (prisma#23476)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Piotrowski <[email protected]>
Co-authored-by: Jon Harrell <[email protected]>
Co-authored-by: Joël Galeran <[email protected]>
  • Loading branch information
4 people authored Mar 13, 2024
1 parent c3df41b commit 79cc79f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/adapter-d1/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prisma driver adapter for Cloudflare D1

Prisma driver adapter for [Cloudflare D1](https://developers.cloudflare.com/d1/).
Prisma driver adapter for [Cloudflare's D1 database](https://developers.cloudflare.com/d1/).

> [!IMPORTANT]
> We do not recommend using the adapter in a production environment yet.
Expand All @@ -27,7 +27,7 @@ datasource db {
}
```

Install Prisma Client, Prisma adapter for Cloudflare D1, Prisma CLI, Cloudflare's workers types and Wrangler CLI packages:
Install Prisma CLI, Prisma Client, the Prisma adapter for Cloudflare D1, the TypeScript types for Cloudflare Workers, and Wrangler CLI packages:

```sh
npm install @prisma/client@early-access
Expand All @@ -51,12 +51,13 @@ import { PrismaClient } from '@prisma/client'
import { PrismaD1 } from '@prisma/adapter-d1'

export interface Env {
// This must match the binding name defined in your wrangler.toml configuration
MY_DATABASE: D1Database
}

export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
// Setup Prisma Client with the adapter
// Initialize Prisma Client with the D1 adapter
const adapter = new PrismaD1(env.MY_DATABASE)
const prisma = new PrismaClient({ adapter })

Expand Down

0 comments on commit 79cc79f

Please sign in to comment.