Brendonovich / prisma-client-rust

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

Support to generate different files according to the model #397

Closed tingfeng-key closed 10 months ago

tingfeng-key commented 10 months ago

After I use the latest version of PCR to generate a file, the content of the file is compressed very much, which affects viewing the generated code. When I want to operate, I often check the parameters that the method needs to pass. I am sure that this affects me. Very big.

Then I only have thirteen models now, but the generated file does reach 909K. I open it with vscode, and use the jump in the file to view the data type of the operation method. It will be stuck for a long time.

Brendonovich commented 10 months ago

This was implemented in #368, I may consider backporting it to 0.6.x

tingfeng-key commented 10 months ago

I didn't notice this PR, I'm sorry, this feature is so good, we should say it on the documentation, I will use it now, thank you very much

tingfeng-key commented 5 months ago

After upgrading to the latest version, no directories will be generated, but files will be generated


prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.11", default-features = false, features = [
    "postgresql",
] }
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.11", default-features = false, features = [
    "postgresql",
] }
generator client {
  provider      = "cargo prisma"
  output        = "../service/src/generate_prisma"
  module_path   = "generate_prisma"
  client_format = "folder"
}
Brendonovich commented 5 months ago

This feature currently isn't available in 0.6.x, only on main