-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview feature feedback: Deno support (deno
)
#15844
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
That worked \o/ As a follow-up, is there any way to generate a client for Deno without using Data Proxy? I can see that the output dir has a |
Not yet, no - that is the next phase we will be working on together with the Deno team. Not having a local engine file made adding support much easier (as we could build on our Edge Client), so we started with that. We are optimistic the other variant will work as well though, and we will add that to this preview feature (and announce it in our release notes when it happens). For now we are happy about any feedback about using Prisma Client for Data Proxy with Deno 🦖 |
Feedback for
In addition, the commands generate the following warnings in console:
|
Thanks for the detailled list!
That is currently expected, see my explanation above: #15844 (comment) (In hindsight we could have disabled
That should not be the case any more now - it was while Data Proxy deployed the new version. If you keep getting this when final
These are known and something for Deno to fix. No functionality is impacted by this as far as we know. (I'll try to find out how and if they are tracking this in issues so we can link to them.) |
Now that it is officially out, I described the current state of what this feature is in this comment to the feature request: #2452 (comment) |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Works fine 👍 Thx! |
This comment was marked as outdated.
This comment was marked as outdated.
I have been using this since yesterday, and it works pretty well for my simple project. Thank you for doing this. Some feedback - from most to least important:
|
All valid points and on our list @patryk-smc 👍
We are very aware of that and that will be our big second iteration of the
Those are limitations in Deno right now, fortunately, they do not seem to impact functionality.
That is honestly more an oversight (which we noticed quite late) and we will fix that.
Agreed. For now it is necessary, but I just replied here how we will hopefully be able to fix that: #2452 (comment) |
Hey, @janpio do you have any eta for being able to use Prisma Deno without data platform? |
No, unfortunately not. We are both working on it. |
Looks like this is no longer needed once you import dotenv from the stdlib from any file that requires the .env file to be loaded: I tried this with the seed.ts and it worked for me. |
Exactly same behaviour here, no need to use |
I had a problem with the generator inside docker. I guess node/npm is necessary to be installed. I tried it before with my own machine, it works smoothly even with npx, the code does generate, if I try on docker, it always fail due to prisma client not being installed. I'm running on deno 1.28.3 and prisma 4.7.0 |
Can you share the steps you are following exactly @yarabramasta so we can reproduce this? I have an idea waht might be going on here, but with a reproduction we can really look at it. |
Sorry for my late responses. Here is the detail what i'm talking about. schema.prismagenerator client {
provider = "prisma-client-js"
output = "../gen/client"
previewFeatures = ["deno"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model User {
id String @id @default(cuid())
@@map("users")
} Result on my own machine[yarabramasta@yb-archx64 api]$ yarn -v && npm -v
1.22.19
8.19.2
[yarabramasta@yb-archx64 api]$ deno run -A --unstable npm:prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "urbanlamp" at "ap-southeast.connect.psdb.cloud:3306"
The database is already in sync with the Prisma schema.
Running generate... (Use --skip-generate to skip the generators)
✔ Generated Prisma Client (4.7.1 | library) to ./gen/client in 214ms
Warning: Not implemented: ChildProcess.prototype.disconnect
[yarabramasta@yb-archx64 api]$ ls -al gen/client
total 40472
drwxr-xr-x 4 yarabramasta yarabramasta 4096 Dec 6 09:32 .
drwxr-xr-x 3 yarabramasta yarabramasta 4096 Dec 6 09:32 ..
drwxr-xr-x 2 yarabramasta yarabramasta 4096 Dec 6 09:32 deno
-rw-r--r-- 1 yarabramasta yarabramasta 3916 Dec 6 09:32 index-browser.js
-rw-r--r-- 1 yarabramasta yarabramasta 54069 Dec 6 09:32 index.d.ts
-rw-r--r-- 1 yarabramasta yarabramasta 5492 Dec 6 09:32 index.js
-rwxr-xr-x 1 yarabramasta yarabramasta 41346976 Dec 6 09:32 libquery_engine-debian-openssl-3.0.x.so.node
-rw-r--r-- 1 yarabramasta yarabramasta 110 Dec 6 09:32 package.json
drwxr-xr-x 2 yarabramasta yarabramasta 4096 Dec 6 09:32 runtime
-rw-r--r-- 1 yarabramasta yarabramasta 270 Dec 6 09:32 schema.prisma My machine had node & npm installed. Dockerfile
Result from docker buildDocker build command docker build -t org.bram.urbanlamp:api --build-arg DATABASE_URL . Result from build Prisma schema loaded from schema.prisma
Datasource "db": MySQL database "urbanlamp" at "ap-southeast.connect.psdb.cloud:3306"
The database is already in sync with the Prisma schema.
Warning: Not implemented: ChildProcess.prototype.disconnect
Removing intermediate container 07b9f3b9bb30
---> 2fe72fec5911
Step 10/27 : RUN deno run -A --unstable npm:prisma generate
---> Running in 6a13b2764926
Prisma schema loaded from schema.prisma
napi_add_env_cleanup_hook is currently not supported
✔ Created ./package.json
Error: Command failed with ENOENT: npm install -D [email protected]
No such file or directory (os error 2)
The command '/bin/sh -c deno run -A --unstable npm:prisma generate' returned a non-zero code: 1 As you can see, the migration is successful, but not for the generated code. And my point is, deno container cannot see the npm executable |
I tried this before, but no luck. And as far as I'm concern, this is a bad practice if you want to keep your image stay
I'm just an intermediate, so please correct or suggest me for this workaround if you have advice. |
No, this makes sense. For now Prisma CLI did not remove or adapt all the assumptions that it might have about |
Deno implemented |
There is an issue about the |
When using the Dockerfile from @yarabramasta we now get the following error:
Any idea why this is happening? Dockerfile
|
Is there any way currently to use this without data proxy? This would be a vital step to use it locally with for example SQLite |
I'm having the same problem of @halvardssm, but I trying to use with planetscale |
I started to get the following error deno run -A --unstable npm:[email protected] generate --data-proxy
Prisma schema loaded from prisma/schema.prisma
✔ Created ./package.json
added 2 packages, and audited 3 packages in 1s
found 0 vulnerabilities
added 2 packages, and audited 5 packages in 1s
found 0 vulnerabilities
✔ Installed the @prisma/client and prisma packages in your project
Error: Generator "/Users/franciscoramos/Documents/clau/code/clau/node_modules/@prisma/client/generator-build/index.js" failed:
error: could not find npm package for 'file:///Users/franciscoramos/Documents/clau/code/clau/node_modules/@prisma/client/generator-build' I tried with
and same error, what is weird is that It was working just fine, but all of a sudden made a schema change, and generate command stop working, even for new empty schemas with just user class My schema generator client {
provider = "prisma-client-js"
previewFeatures = ["deno"]
output = "./generated/client"
}
datasource db {
provider = "mongodb"
url = env("PROXY_DB_URL")
directUrl = env("DB_URL")
}
model users {
// Base
uuid String @id @default(uuid()) @map("_id")
createdAt DateTime? @default(now())
updatedAt DateTime? @updatedAt()
// Data
email String?
phone String?
name String?
} |
I found that it was a Prisma issue (I think) having these specific versions of Prisma fixed the issue "devDependencies": {
"prisma": "^4.15"
},
"dependencies": {
"@prisma/client": "^4.11"
} mmmm also have to downgrade to deno 1.34.1 so maybe a deno issue? denoland/deno#19590 |
@HansKristoffer Right now Prisma via Deno CLI still needs @halvardssm Not yet, working on it. @fro-profesional I think that is just random, sometimes |
Update: Prisma without Data Proxy is now "usable" in Deno. Still rough corners, but we are getting there: #2452 (comment) |
Please share your feedback about the
deno
functionality released in v4.5.0 in this issue.The current state of our implementation is described here: #2452 (comment)
If you have any questions, don't hesitate to ask them in the
#orm-help
channel in the Prisma Slack.The text was updated successfully, but these errors were encountered: