How fix lint operator does not exist: uuid = text #198
Answered
by
Newbie012
sergiohdljr
asked this question in
Q&A
-
I have the following code : On this table the column id has a UUID type, wich i am comparing with a id send from the params, that is actually a UUID but as a string. any ideias how i could fix that ? (i am open for database remodelation too) |
Beta Was this translation helpful? Give feedback.
Answered by
Newbie012
Apr 27, 2024
Replies: 1 comment 5 replies
-
this is the way sql`DELETE FROM farmacia WHERE id = ${id}::uuid` |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sergiohdljr there are many libraries which support branded types such as zod's
brand
.First, define your UUID brand:
Second, tell SafeQL to treat
uuid
as your brandedUUID
(instead of the defaultstring
) usingoverrides.types
:Lastly, this is how you code should like: