[query] Don't allow ordering by things that Mentat considers incomparable #271

Open
opened 2020-08-06 16:57:40 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:57:40 +00:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#271
No description provided.