P
Prisma2mo ago
Ben

Should the new typescript client and engine be excluded from source control?

There seem to be mixed messages about whether the new TypeScript engine and client should be excluded from source control. This page: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/no-rust-engine doesn't mention excluding the engine but previous pages: https://www.prisma.io/docs/orm/prisma-schema/overview/generators#prisma-client do say to exclude the client (with a comment that this won't be necessary in the future) The issue I'm having is with the full paths that get created in the class.ts file which causes noise as different people build the client. Should the pure TypeScript client be in source control?
Use Prisma ORM without Rust engines | Prisma Documentation
Learn how to use Prisma ORM without Rust engines
Generators (Reference) | Prisma Documentation
Generators in your Prisma schema specify what assets are generated when the prisma generate command is invoked. This page explains how to configure generators.
8 Replies
Prisma AI Help
Prisma AI Help2mo ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
Craig vs The Machine
Not an expert. My understanding is that, previous to 6.16 and their movement towards not having the Rust engine, you didn't include it in source control. Starting now, and enforced in 7, you output your generated client to a location outside of node_modules, and you include it in source control. That way, you don't have to do prisma generate as part of your prod deployment. This prevents people from having to prisma generate unless they make a change to prisma.
Ben
BenOP2mo ago
That was my understanding as well but we have a call to generate in our dev build command to make sure changes are picked up quickly. So the client is getting rebuilt a lot by different people.
Nurul
Nurul2mo ago
Generators (Reference) | Prisma Documentation
Generators in your Prisma schema specify what assets are generated when the prisma generate command is invoked. This page explains how to configure generators.
Craig vs The Machine
Oh, hmmm ... So, this makes no sense then ... because the documentation says that I shouldn't need the Rust engine anymore if I have it set up right. But I definitely download libquery_engine-darwin-arm64.dylib.node if I run prisma generate
Nurul
Nurul2mo ago
The code shipped for Query Execution doesn't have any Rust part anymore. It's shipped as a WASM module. The CLI portion, for example the Prisma Migrate commands still rely on Rust which is why you might see Query Engine being downloaded. We plan to gradually remove Rust from CLI commands as well.
Ben
BenOP2mo ago
@Nurul Thank you for confirming. I suggest updating the first link I shared to make it clear there because I followed that page and didn't look anywhere else.
Craig vs The Machine
@Nurul When you say "gradually", is that for version 7? What's the timeline on that? We basically can not use the engine for what we're trying to do, after I spent a couple weeks refactoring away from Typeorm. We can maybe download the engine and self host in the short , but we don't want to do that long-term. We're having a meeting about whether we should switch to Drizzle/MikroORM, or stick with Prisma and just deal with the engine issue in the short term.

Did you find this page helpful?