[query] Don't allow ordering by things that Mentat considers incomparable
gburd opened this issue · comments
Greg Burd commented
Right now, we don't allow comparing refs:
mentat=> .q [:find ?v :where [?e ?a ?v] [(> ?e 10)]]
Error(MentatError(QueryError(InvalidArgumentType(PlainSymbol(">"), ValueTypeSet({Instant, Long, Double}), 0))), State { next_error: None, backtrace: None }).
But we do accept ordering by ref:
mentat=> .q [:find ?v :where [?e ?a ?v] :order ?e :limit 2]
| ?v |
---
| :db/ident |
| 24 |
---
This ticket tracks being consistent.
A harder problem is to track entities that we know are transactions, and to allow comparing and ordering those transactions refs.