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

Specta is broken for `main` branch #414

Closed Ziothh closed 7 months ago

Ziothh commented 7 months ago

405 allows me to use pcr-cli on NixOS but only on main.

Because I have to use the main branch I can't use anything related to specta (v2.0.0-rc.1 does not compile).

I fixed that locally by cloning both rspc and pcr and bumping specta to v2.0.0-rc.6. Now I'm left with this error:

$ cargo prisma generate
# ... Snip
error: specta: expected path. Eg. `String` or `std::string::String`
 --> prisma/src/prisma.rs:3:25685
  |
3 | ...ecta (rename = "User" , crate = "prisma_client_rust::specta")] pub struct Data { # [serde (r...
  |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: specta: expected path. Eg. `String` or `std::string::String`
 --> prisma/src/prisma.rs:3:56238
  |
3 | ...ecta (rename = "Todo" , crate = "prisma_client_rust::specta")] pub struct Data { # [serde (r...
  |
# ... Snip

It seems like the interface for #[specta(...)] has changed. (Line in pcr that uses that macro: /crates/generator-macros/src/partial_unchecked.rs:73)

I tried to fix the reason for this error, but failed. Macros still are magic to me.

oscartbeaumont commented 7 months ago

I suspect this one is my bad and related to my incorrect locking of the version of specta-macros. oscartbeaumont/specta#173

You could probally try the spacedrive-rspc-v1 for an updated Specta or alternatively add specta-macros = { version = "=2.0.0-rc.1" } into your Cargo.toml temporarily.