Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.83k stars 108 forks source link

Support --generator for supporting both nodejs and rust at the same time #373

Closed kielerdotdev closed 1 year ago

kielerdotdev commented 1 year ago

As of 0.6.8 i cannot get prisma client rust to generate a client if there exists multiple generators

generator client {
  provider = "cargo prisma"
}

generator clientJS {
  provider = "prisma-client-js"
}

generating the client for nodejs is pretty easy, just only target one generator with the --generator flag https://github.com/prisma/prisma/pull/16452

with prisma client rust it does not generate the client at all, and the --generator flag does not exist, which i would be able to use to only target the rust generator.

without using the --generator flag (which does not exist) it fails on...

Error: Generator at /workspace/node_modules/@prisma/client/generator-build/index.js could not start:

node:internal/modules/cjs/loader:936
  throw err;
  ^
Error: Cannot find module '/workspace/packages/search/--max-old-space-size=8096'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
Brendonovich commented 1 year ago

Duplicate of https://github.com/Brendonovich/prisma-client-rust/issues/263