-
Hi! Can we use 'like' operators (in/ini) when filtering by the id of type UUID? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
You should be able to use in/ini on UUID types. You should also be able to use infix, prefix, and postfix. For 'like' operators, the requirement is that there exists a Serde to map the field type to a String. Let me know if something isn't working as expected. |
Beta Was this translation helpful? Give feedback.
-
Elide already has built in support for UUID so you shouldn’t have to define
a Serde in this instance.
…On Mon, Jan 31, 2022 at 10:59 PM Asky-GH ***@***.***> wrote:
Should my Serde look like this?
@ElideTypeConverter(type = UUID.class, name = "UUID")public class UUIDSerde implements Serde<String, UUID> {
@OverRide
public UUID deserialize(String value) {
return UUID.fromString(value);
}
@OverRide
public String serialize(UUID value) {
return value.toString();
}
}
—
Reply to this email directly, view it on GitHub
<#2529 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVH6QNOSMLFLCZOSHF5R4LUY5SEFANCNFSM5NEPKUZQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I dug into this and have two thoughts:
|
Beta Was this translation helpful? Give feedback.
-
I'm thinking about moving the validation logic for predicates to allow this. One unfortunate problem though is that there are really three different representations for a UUID - the client representation (String with hyphens), the in memory representation (a UUID object), and the database representation (String without hyphens). Elide does filtering potentially both in the database and in-memory. When doing 'like' style queries, the client filter will include hyphens which will work fine in-memory but not in the database. To leverage 'like' predicates, you would also have to override the database serialization of the UUID to include hyphens. Let me know if this is still useful. |
Beta Was this translation helpful? Give feedback.
I'm thinking about moving the validation logic for predicates to allow this. One unfortunate problem though is that there are really three different representations for a UUID - the client representation (String with hyphens), the in memory representation (a UUID object), and the database representation (String without hyphens). Elide does filtering potentially both in the database and in-memory. When doing 'like' style queries, the client filter will include hyphens which will work fine in-memory but not in the database. To leverage 'like' predicates, you would also have to override the database serialization of the UUID to include hyphens. Let me know if this is still useful.