deno icon indicating copy to clipboard operation
deno copied to clipboard

`--unstable` needed to generate Prisma client

Open GJZwiers opened this issue 3 years ago • 5 comments

I'm following along with the Deno + Prisma tutorial but it seems --unstable is needed or the client will not be generated. Maybe this can be updated in the tutorial?

deno run -A npm:prisma@^4.5 generate --data-proxy
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Unstable API 'node-api'. The --unstable flag must be provided.
deno run -A --unstable npm:prisma@^4.5 generate --data-proxy
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
napi_add_env_cleanup_hook is currently not supported
✔ Created ./package.json

added 2 packages, and audited 3 packages in 5s

found 0 vulnerabilities

added 2 packages, and audited 5 packages in 4s

found 0 vulnerabilities

✔ Installed the @prisma/client and prisma packages in your project

✔ Generated Prisma Client (4.6.1 | dataproxy) to .\generated\client in 446ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client  
/```
import { PrismaClient } from './generated/client'
const prisma = new PrismaClient()
/```

To use Prisma Client with Deno and the Data Proxy, import it like this:
/```
import { PrismaClient } from './generated/client/deno/edge.ts'
/```

You will need a Prisma Data Proxy connection string. See documentation: https://pris.ly/d/data-proxy

Warning: Not implemented: ChildProcess.prototype.disconnect

GJZwiers avatar Nov 19 '22 12:11 GJZwiers

You need at least deno 1.28 version

sigmaSd avatar Nov 19 '22 16:11 sigmaSd

I am on Deno 1.28.1

GJZwiers avatar Nov 19 '22 16:11 GJZwiers

@lambtron please take a look

bartlomieju avatar Nov 20 '22 09:11 bartlomieju

Same here

deno --version
deno 1.29.1 (release, x86_64-unknown-linux-gnu)
v8 10.9.194.5
typescript 4.9.4

VictorHAS avatar Dec 26 '22 20:12 VictorHAS

Just a heads up: it will take some time before we decide to stabilize NAPI support, might happen in Q1/Q2 '23.

bartlomieju avatar Dec 29 '22 22:12 bartlomieju