Postgrex/Ecto custom operators in queries for custom types

Can’t google any info on the subject. Is there a way to implement custom operators, for example, for ltree extension?

I would like to use it in queries in this way

from o in "objects",
          where: o.path ~ "some.lquery.*",
          select: o.content

SELECT content FROM objects WHERE path ~ 'some.lquery.*';

You cannot add custom operators, but you can use fragments + macros to add custom “functions” to the query api.


yep, works too, thanks