MCPcopy
hub / github.com/prisma/prisma / fetch

Function fetch

packages/client/tests/e2e/enum-import-in-edge/src/index.ts:5–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4export default {
5 fetch() {
6 const adapter = new PrismaD1({
7 CLOUDFLARE_DATABASE_ID: '',
8 CLOUDFLARE_D1_TOKEN: '',
9 CLOUDFLARE_ACCOUNT_ID: '',
10 })
11 // When using Prisma Client in an edge runtime it would error like this:
12 // ... is unable to run in an edge runtime. As an alternative, try Accelerate: https://pris.ly/d/accelerate.
13 // But that should only happen when executing a query
14 // This tests that creating an instance of PrismaClient does not error
15 // eslint-disable-next-line @typescript-eslint/no-unused-vars
16 const db = new PrismaClient({ adapter })
17
18 const data = {
19 Role,
20 ModelName: Prisma.ModelName,
21 }
22
23 return new Response(JSON.stringify(data))
24 },
25}

Callers 10

requestMethod · 0.50
findUniqueFunction · 0.50
$__internalBatchFunction · 0.50
queryStatusAPIFunction · 0.50
parseMethod · 0.50
onEventFunction · 0.50
statusMethod · 0.50
captureMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected