Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

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

Open
ncalexan opened this issue Jun 18, 2018 · 2 comments
Open
Labels
A-query Issues or requests for query capabilities. enhancement

Comments

@ncalexan
Copy link
Member

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.

@ncalexan ncalexan added enhancement A-query Issues or requests for query capabilities. labels Jun 18, 2018
@rnewman
Copy link
Collaborator

rnewman commented Jun 18, 2018

I thought I had a branch for that…

@rnewman
Copy link
Collaborator

rnewman commented Jun 18, 2018

Search for TxAfter, and see discussion in the PR that added it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-query Issues or requests for query capabilities. enhancement
Projects
None yet
Development

No branches or pull requests

2 participants