Closed Roms1383 closed 3 years ago
diesel = { ... features = [..., "uuidv07", ...] }
uuid = { version = "0.8", ... }
Hm...
Yes @Mingun that's what I have already (please check the Cargo.toml
excerpt).
@Mingun or do you mean remove the uuid
dependency ?
I mean that you probably need to use "uuid" feature of the diesel
crate or use uuid
with version <=0.7.
There are several closed issues in this repo with similar "trait not implemented" errors that connected with incompatible versions of dependencies
well if I switch to :
[dependencies]
diesel = { version = "1.4.5", features = ["postgres", "chrono", "r2d2", "uuidv07", "numeric"] } # <-- using uuid feature as before
uuid = { version = "0.6", features = ["serde", "v4"] } # <-- with 0.6 version here
The problem is then I end up with compilation errors like :
And :
I have also tried in that different setup :
diesel = { version = "1.4.6", features = ["postgres", "chrono", "r2d2", "uuid", "numeric"] }
uuid = { version = "0.8.2", features = ["serde", "v4"] }
By switching uuid
's to_hyphenated()
method to hyphenated()
but then running into these compilation errors :
Or even :
diesel = { version = "1.4.6", features = ["postgres", "chrono", "r2d2", "uuid", "numeric"] }
uuid = { version = "0.6.5", features = ["serde", "v4"] }
But no matter which I'm still running into these compilation errors :
So I must admit that I'm a little bit confused here @Mingun.
@Mingun wouldn't it make sense to simply add :
impl TextOrNullableText for Uuid {}
impl TextOrNullableText for Nullable<Uuid> {}
@Roms1383 This error is expected as this would not generate valid SQL. Postgres does only support LIKE
and similar operations on string types (so Text
, VarChar
and similar types). A expression of the type Uuid
is not supported as left hand side of a LIKE
expression. See the postgres documentation for details.
Closed as everything works as expected, which means in this case we turned a runtime error in your SQL query into a compile time error.
@Mingun That's totally unrelated to the uuid version and so on
@Mingun Ok, is there another way to go to implement a LIKE
or ILIKE
search on a partial string representation of Uuid
parameter ?
e.g. ... WHERE id LIKE '2127%'
@Roms1383 To make that clear: @Mingun Is not related to the diesel project in any way. They are just a person that commented on this issue trying to help you. Otherwise our issue tracker is not the right place to ask questions please use any of the other support variants for this.
Ok thanks @weiznich I'm gonna look into it
Hello, thanks for this wonderful library !
I ran this morning into an issue when trying to use
like
on table fields of typediesel::sql_types::Uuid
.Setup
Versions
Feature Flags
Problem Description
When trying to use
like
orilike
(for Postgres) with a diesel table field of typeUuid
, I run into the missing implementation ofdiesel::expression_methods::TextOrNullableText
fordiesel::sql_types::Uuid
.What are you trying to accomplish?
Just using
LIKE
filter on a query.What is the expected output?
It should be able to filter
diesel::sql_types::Uuid
withLIKE
.What is the actual output?
Compilation error as shown above.
Are you seeing any additional errors?
None.
Steps to reproduce
Checklist
Thanks :)