From 016c9c82415eb8c00c6a0be282b9ad13f3ce0e97 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Sun, 16 Apr 2023 13:13:36 -0700 Subject: [PATCH] update docs --- doc/QUERY.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/QUERY.md b/doc/QUERY.md index 24d5ef7..119f936 100644 --- a/doc/QUERY.md +++ b/doc/QUERY.md @@ -162,19 +162,21 @@ aec517e53c6ac022f2b4cc91261daab5651cebf0 b0ff6f29dd2846e97f8aa85a2ca73736b03254a8 ``` -`jq`s `select` acts on a stream of JSON objects, not a list, so it filters as the objects are generated. The alternative would be to print the entire JSON list at the end, like: +`jq`s `select` function acts on a stream of JSON objects, not a list, so it filters the output of `hpi query` the objects are generated (the goal here is to conserve memory as items which aren't needed are filtered). The alternative would be to print the entire JSON list at the end, like: `hpi query my.coding.commits.commits --recent 30d | jq '.[] | select(.repo | contains("Repos/HPI"))' | jq '.sha' -r`, using `jq '.[]'` to convert the JSON list into a stream of JSON objects. ## Usage on non-HPI code -The command can accept any qualified function name, so this could for example be used to check the output of [`promnesia`](https://github.com/karlicoss/promnesia) commands: +The command can accept any qualified function name, so this could for example be used to check the output of [`promnesia`](https://github.com/karlicoss/promnesia) sources: ``` hpi query promnesia.sources.smscalls | jq length 371 ``` +This can be used on any function that produces an `Iterator`/`Generator` like output, as long as it can be called with no arguments. + ## GPX The `hpi query` command can also be used with the `--output gpx` flag to generate GPX files from a list of locations, like the ones defined in the `my.location` package. This could be used to extract some date range and create a `gpx` file which can then be visualized by a GUI application.