Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query :limit #126

Open
mokr opened this issue Jun 20, 2022 · 3 comments
Open

Query :limit #126

mokr opened this issue Jun 20, 2022 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@mokr
Copy link

mokr commented Jun 20, 2022

Add support for query :limit (and related :offset)

Based on response on Slack and googled suggestions for Datomic, there seems to be at least two alternatives for implementation:

  1. In the map form of q. Like {:query '[:find ... :where ...] ... :limit 20 offset: 40}
  2. In the map form of the query itself like {:find ... :where ... :limit 20 offset: 40}.

Alternative 1 reflects the suggestion in this response in Datomic forum (documented here). One benefit I see for this approach is that it allows you to keep queries in vector form (possibly in a separate file) and only wrap them up in a map when limiting is needed.

If it fits and is not already implemented, support for :timeout could be added as well.

@huahaiy
Copy link
Contributor

huahaiy commented Jun 20, 2022

Putting :limit etc. in the vector form works too. A vector actually has more freedom than a map, as it does not have to be an even number of items.

@huahaiy
Copy link
Contributor

huahaiy commented Sep 19, 2022

Seems to be related to #117

@huahaiy huahaiy added the enhancement New feature or request label Nov 28, 2022
@huahaiy
Copy link
Contributor

huahaiy commented Apr 19, 2024

:timeout is already supported.

@huahaiy huahaiy added this to the 1.0.0 milestone Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants