P
Prisma6mo ago
tony

prisma-client "Model" suffix?

The "prisma-client" early access docs say to import models like this
import { User, Post } from "./generated/prisma/models.js"
import { User, Post } from "./generated/prisma/models.js"
However, all the models seem to have "Model" appended to the end, e.g. UserModel, PostModel, etc. Is this due to a recent change? Is there a pull request when this changed? Is this expected behavior? Is there any way to customize this?
4 Replies
Prisma AI Help
Prisma AI Help6mo ago
You selected to wait for the human sages. They'll share their wisdom soon. Grab some tea while you wait, or check out #ask-ai if you'd like a quick chat with the bot anyway!
tony
tonyOP6mo ago
I think the docs are wrong. It looks like I am able to access the proper model by doing
import { User, Post } from "./generated/prisma/client.js"
import { User, Post } from "./generated/prisma/client.js"
I would really prefer if the model file exported the correct name Otherwise I am stuck importing the client when I only want the models / enums
Nurul
Nurul6mo ago
Thanks for raising the issue. If I understand correctly, the docs should say
import { User, Post } from "./generated/prisma/client.js"
import { User, Post } from "./generated/prisma/client.js"
instead of
import { User, Post } from "./generated/prisma/model.js"
import { User, Post } from "./generated/prisma/model.js"
right?

Did you find this page helpful?