medz / prisma-dart

Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
https://prisma.pub
BSD 3-Clause "New" or "Revised" License
459 stars 31 forks source link

Error when using "npx prisma generate" to create the "generated_dart_client" folder #407

Closed 1tsmhmd closed 4 months ago

1tsmhmd commented 4 months ago

When I run the command npx prisma generate , I encounter errors.

.env file image

schema.prisma image

npx prism generate image

after the generate image

what shoul i do?

medz commented 4 months ago

@iamhaghigh1 So what is the error? Your screenshot shows that the file reports an error. But you need to expose the specific error.

medz commented 4 months ago

In addition, I noticed that you are using version 4.1. Can you use version 5.0?

Because this project is currently maintained by me alone, and there is no collaborator. So I don't have time to maintain the previous major version.

Therefore, the current maintenance strategy is to only maintain the current major version, and all bugs are fixed in the current major version.

1tsmhmd commented 4 months ago

In the training course, he said to use version 4.16.2, because the higher version has problems. I tried both version 4.16.2 and the latest version, but it still has a problem.

I use the latest version. image

there are too many errors image image image image image image image

Which version should I use and which version do you suggest I install?

medz commented 4 months ago

@iamhaghigh1 The training course was probably written in the 4.x era, when Prisma made breaking changes that caused some unforeseen problems.

But they were fixed in subsequent versions. I recommend you use orm: ^5.0.4 and the latest version of Prisma CLI (5.16).

In addition, I noticed that you might be using a more stringent custom lint rule. The orm package only satisfies package:lints/recommended.yaml, so you need to exclude the generated files from your custom lint rules. If you use the package:lints/recommended.yaml rule, no processing is required.

medz commented 4 months ago

You can find the examples we provide at https://github.com/medz/prisma-dart/tree/main/examples, but we do not use more stringent third-party custom lint rules.

medz commented 4 months ago