There’s this query
“SELECT * FROM connection "
" JOIN deal ON connection.connection_id "
" = deal.deal_connections.connection_id "
" WHERE deal.deal_id = :deal_id”
and following error
Error reported from Kalix system: KLX-00123 Bad grammar in view query: Values of types “CHARACTER VARYING” and “CHARACTER VARYING ARRAY” are not comparable;
can you late me know where can I find documentation to fix it?
Sorry, it won’t be possible to have a query like this currently.
As the error message reports, the join condition is comparing different types.
It’s comparing the connection id on the left side to an array of connection ids on the right side. Where
deal_connections is an array of objects, and
deal.deal_connections.connection_id will extract the connection id for each deal connection, creating an array of connection ids.
For this query you need to use an
= ANY(...) comparison, but that’s not currently supported for join conditions. Join conditions are limited to equals (
=). Extending this to other comparisons is planned. For now, you’ll need to have the data in a form where joining with an exact comparison between the same types is possible.
Ok , thanks for the reply, will try to optimize the domain model further to see