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

select! and include! from different crate #403

Open fedeci opened 9 months ago

fedeci commented 9 months ago

Hi! Currently select! and include! macros can only me used within the same crate. What do you thing about allowing to define a global crate path?

// schema.prisma
generator client {
  provider    = "cargo prisma"
  output      = "../pg/src/prisma.rs"
  module_path = "pg::prisma"
  same_crate_module = false // defaults to true to be non-breaking
}

The previous links the pg::prisma module to the macros. When same_crate_module is true or it is not set, it links crate::pg::prisma.

Brendonovich commented 9 months ago

This isn't a problem on main, as I use $crate. I may consider backporting it to 0.6.