finish implementing the query builder #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this PR it was possible to do a simple
{:find ... :where }but more sophisticated queries were not yet possible.Now we have full support for the query keywords
:find,:where,:in,:rules,:order-by,:limit,:offset, and:timeout. For the:inclause we also provide an.in_args()to bind arguments to those parameters. In other words you can now form a query like this:which is equivalent to
with
firstbound to "Billy" andlastbound to "Joel".Because the underlying
pyxtdb.Node.query()method supports EDN parsed from strings, so do these methods, in other words if you wanted to you could form the same query like this:This latter form might be a bit more amenable to people wanting to construct queries dynamically. It remains to be seen how that plays out in practice.