Comments (6)
My current understanding would be that it should pass a path to the engine, yes. But I am not aware of anyone using that, so might also be utterly broken. A quick read through the generator code on Prisma side might give clarity if this can even work.
from prisma-client-py.
The generator process of Prisma CLI prisma generate
can also take care of downloading and supplying the Query Engine to a generator artifact. The API is mostly untested (and I would actually have to dig it up), but if you want to work on that, ping me on our public Slack and I can def make something happen.
Maybe it would also help to describe how you currently handle the engines here (and the CLI as well probably).
from prisma-client-py.
@janpio Thank you! I will definitely make use of that if I start working on this.
prisma generate can also take care of downloading and supplying the Query Engine to a generator artifact
I did notice that while reading through some prisma code and added it but don't make use of it:
prisma-client-py/src/prisma/jsonrpc.py
Line 35 in 33dc2c0
Do you know if prisma passes the resolved engine binary to the generator?
from prisma-client-py.
You are correct it does pass the engine path to the generator.
However even though the native binaries are successfully downloaded, the following error is thrown when running prisma generate
with and without binary targets.
prisma:loadEnv skipping package.json at /package.json +0ms
prisma:tryLoadEnv Environment variables not found at null +0ms
prisma:tryLoadEnv Environment variables not found at undefined +1ms
prisma:tryLoadEnv No Environment variables loaded +0ms
prisma:engines binaries to download query-engine, migration-engine, introspection-engine, prisma-fmt +0ms
Prisma schema loaded from tests/data/schema.prisma
plusX Execution permissions of /private/var/folders/ql/0v8h20s972s6zz4t_3qc49bc0000gp/T/prisma-binaries/query-engine-darwin are fine +0ms
prisma:getConfig Using Query Engine Binary at: /private/var/folders/ql/0v8h20s972s6zz4t_3qc49bc0000gp/T/prisma-binaries/query-engine-darwin +0ms
plusX Execution permissions of /private/var/folders/ql/0v8h20s972s6zz4t_3qc49bc0000gp/T/prisma-binaries/query-engine-darwin are fine +505ms
prisma:getDMMF Using Query Engine Binary at: /private/var/folders/ql/0v8h20s972s6zz4t_3qc49bc0000gp/T/prisma-binaries/query-engine-darwin +0ms
prisma:getGenerators neededVersions {
"60b19f4a1de4fe95741da371b4c44a92f4d1adcb": {
"engines": [
"queryEngine"
],
"binaryTargets": [
{
"fromEnvVar": null,
"value": "darwin"
},
{
"fromEnvVar": null,
"value": "rhel-openssl-1.0.x"
}
]
}
} +0ms
prisma:download file /snapshot/node_modules/prisma/query-engine-darwin does not exist and must be downloaded +0ms
prisma:download file /snapshot/node_modules/prisma/query-engine-rhel-openssl-1.0.x does not exist and must be downloaded +0ms
Error: Error: File '/**/node_modules/prisma/query-engine-darwin' was not included into executable at compilation stage. Please recompile adding it as asset or script.
at error_ENOENT (pkg/prelude/bootstrap.js:446:17)
at readFileFromSnapshot (pkg/prelude/bootstrap.js:729:29)
at readFile (pkg/prelude/bootstrap.js:796:5)
at internal/util.js:297:30
at new Promise (<anonymous>)
at readFile (internal/util.js:296:12)
at maybeCopyToTmp (/snapshot/node_modules/prisma/build/index.js:26765:26)
at async download (/snapshot/node_modules/prisma/build/index.js:26562:41)
at async getBinaryPathsByVersion (/snapshot/node_modules/prisma/build/index.js:36480:43)
at async Object.getGenerators (/snapshot/node_modules/prisma/build/index.js:36403:36)
I can provide a full repro if that would help.
from prisma-client-py.
That would be neat.
Are you using pkg
to package the CLI? That is often a pain... (at least it is for our Go Client which does similar things) But of course there is no other real alternative.
from prisma-client-py.
Yes, I have used pkg
before and it was not fun to say the least.
This actually uses the exact same CLI binary as the Go Client does and the engine binaries are handled in a similar way (I essentially just rewrote the Go Client's solution in python).
Here's a reproduction for the issue, it assumes you have python3
installed.
https://github.com/RobertCraigie/prisma-reproductions/tree/main/py-22
from prisma-client-py.
Related Issues (20)
- How to import enum values by prisma-client-py ? HOT 1
- Support schemas that are using the preview feature relationJoins on different generators HOT 1
- Generate Async and Sync client together at the same time HOT 2
- httpx.ConnectError: All connection attempts failed HOT 1
- Once event loop is closed, async client can not be used anymore. HOT 2
- Support accessing the DMMF at runtime HOT 1
- P1011: Error opening a TLS connection: bad protocol version
- Upgrading version from 0.11.0 to 0.12.0 in Elastic Beanstalk fails deployment HOT 1
- Avoid writing to `site-packages/prisma` HOT 1
- When generator client output is set, `prisma db push` fails with Permission Denied
- Is there a way to override use_enum_values?
- `prisma db push` does not work
- v0.13.0 - ImportError: cannot import name 'AbstractEngine' from 'prisma.engine' HOT 4
- Oracle Database not support like alchemy HOT 1
- Oracle not support HOT 1
- httpx.ConnectError: [Errno 111] Connection refused HOT 3
- RuntimeError('Event loop is closed') HOT 2
- schema.prisma on custom path HOT 3
- Bump Prisma version to latest 5.12.1
- Client extension support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma-client-py.