efcore.pg icon indicating copy to clipboard operation
efcore.pg copied to clipboard

Support ltree array query?

Open ColinZeb opened this issue 3 years ago • 1 comments

var posTree = new LTree[]{"A.B","C.D"};
var nq = db.Positions.Where(x => posTree.Any(z=> x.Tree.IsDescendantOf(z)))

Can it translate to sql:

select * from positions p
where ltree2text(p.tree) <@ any(array ['A.B','C.D'])

ColinZeb avatar Feb 18 '22 04:02 ColinZeb

When working on this, consider translating array.Any in a generic way (PG ANY apparently allows any operator).

roji avatar Feb 18 '22 11:02 roji