-
-
Notifications
You must be signed in to change notification settings - Fork 519
Closed
Labels
Description
I'm trying to compare a JSON property in PostgreSQL against a list of values, but the values I'm passing seem to always be flattened into individual parameters instead of the array I'm giving.
A paraphrasing of my code is:
var ids = persistenceQuery.Where
.Where(where => where.ColumnName.EqualsIgnoreCase("typeElementId"))
.Select(where => Guid.Parse(where.Value))
.ToArray();
query.WhereRaw("(json->'typeElementId'->>'guid')::uuid = ANY(?)", ids);
I've also tried this, but it seems to still be flattening the nested array:
query.WhereRaw("(json->'typeElementId'->>'guid')::uuid = ANY(?)", new object[] { new object[] { ids } });
I think this would be solved if I could disable the quoting of column names inside WhereIn
also, as PostgreSQL doesn't seem the JSON column I'm querying as an actual column.