Brendonovich / prisma-client-rust

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

Cannot compile Prisma-cli >= 0.6.2 #192

Closed Congyuwang closed 1 year ago

Congyuwang commented 1 year ago

Cannot compile Prisma-cli tool version 0.6.2 and 0.6.3 due to the following error. Perhaps some dependency version problem? The compiler complain that

Compiling quaint v0.2.0-alpha.13 (https://github.com/prisma/quaint?rev=fb4fe90682b4fecb485fd0d6975dd15a3bc9616b#fb4fe906)
error[E0046]: not all trait items implemented, missing: `visit_text_search`, `visit_matches`, `visit_text_search_relevance`
   --> ~/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/visitor/mssql.rs:182:1
    |
182 | impl<'a> Visitor<'a> for Mssql<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `visit_text_search`, `visit_matches`, `visit_text_search_relevance` in implementation
    |
   ::: /Users/congyuwang/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/visitor.rs:124:5
    |
124 |     fn visit_text_search(&mut self, text_search: TextSearch<'a>) -> Result;
    |     ----------------------------------------------------------------------- `visit_text_search` from trait
...
127 |     fn visit_matches(&mut self, left: Expression<'a>, right: std::borrow::Cow<'a, str>, not: bool) -> Result;
    |     --------------------------------------------------------------------------------------------------------- `visit_matches` from trait
...
130 |     fn visit_text_search_relevance(&mut self, text_search_relevance: TextSearchRelevance<'a>) -> Result;
    |     ---------------------------------------------------------------------------------------------------- `visit_text_search_relevance` from trait

error[E0046]: not all trait items implemented, missing: `visit_text_search`, `visit_matches`, `visit_text_search_relevance`
   --> ~/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/visitor/sqlite.rs:52:1
    |
52  | impl<'a> Visitor<'a> for Sqlite<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `visit_text_search`, `visit_matches`, `visit_text_search_relevance` in implementation
    |
   ::: /Users/congyuwang/.cargo/git/checkouts/quaint-9f01e008b9a89c14/fb4fe90/src/visitor.rs:124:5
    |
124 |     fn visit_text_search(&mut self, text_search: TextSearch<'a>) -> Result;
    |     ----------------------------------------------------------------------- `visit_text_search` from trait
...
127 |     fn visit_matches(&mut self, left: Expression<'a>, right: std::borrow::Cow<'a, str>, not: bool) -> Result;
    |     --------------------------------------------------------------------------------------------------------- `visit_matches` from trait
...
130 |     fn visit_text_search_relevance(&mut self, text_search_relevance: TextSearchRelevance<'a>) -> Result;
    |     ---------------------------------------------------------------------------------------------------- `visit_text_search_relevance` from trait
Brendonovich commented 1 year ago

Are you specifying the database you want to support as documented here? I've seen some issues with selecting the wrong databases.

Brendonovich commented 1 year ago

Actually, run cargo update -p with prisma-client-rust and prisma-client-rust-cli and try again.

Congyuwang commented 1 year ago

Right. It is the problem of having not specified the database. I've specified the database in prisma-client-rust but not in prisma-client-rust-cli.

Congyuwang commented 1 year ago

Not specifying the database in the cli tool used to work in v0.6.1 though.

Brendonovich commented 1 year ago

Yeah 0.6.2 added the database specification option, but it seems that a bug broke backwards compatibility. Should be fixed now though.