ERROR: operator does not exist: uuid = character varying
Here is my relation, and when I tried to run a relational query, it shows this error
14 Replies
ohhh nvm
:)
@tomeverson What was your fix?
i forgor :3
having the same error when using db.query
anyone know what was going on with this? all the sudden starting to see this no clue what the error is referencing
In postgres, the types are strict. They either need to match or be type cast.
In the above case, hubPost.hub is varchar and hub.id is uuid. You can cast the uuid to varchar in a join if you're not using the rqb syntax.
thank you! - now gotta find where i have the mismatch
any idea if theres a way to see which column has the mismatch in the error? i have some fairly complex relations so hard to track it down
Turn logger on. I believe it would be the last query logged before the error occurred
Drizzle ORM - Goodies
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
could it possibly be that in my one to many relationship - the many side has a uuid field but that field can potentially be null - (i.e. if an outbound load has not been assigned to a job support equipment) (sending code in follow up message)
I don't think the field being nullable would cause this specific error. This is about a type incompatibility and the query system being unable to successfully join the two tables.
yeah its weird because i have an "identical" relation on the job model for supportEquipment and it doesn't throw the type error
i've been playing around and now I'm getting this error (granted i think i've abused the QB model and have some extremely complex queries to build) so maybe i need to rethink how im utilizing it but not sure if theres an easier route i can take in the meantime
Hmm. I'm not sure. I know about lateral joins, but drizzle does not appear to have any documentation for using them.
yeah additionally this is all done through query builder which AFAIK you aren't specifying the joins its doing it for you - most likely meaning my nested relations are causing issues for it