XTDB-CLI examples
Changes
I felt we needed some more ready to go Examples on how to use the xtdb-cli tool.
Issue link
You have to create an issue to link to this PR. If this really is not possible, write a very detailed description here and add this PR to the project board directly.
Please add the link to the issue after "Closes".
Closes ...
Demo
Please add some proof in the form of screenshots or screen recordings to show (off) new functionality, if there are interesting new features for end-users.
QA notes
Please add some information for QA on how to test the newly created code.
Code Checklist
- [ ] All the commits in this PR are properly PGP-signed and verified.
- [ ] This PR only contains functionality relevant to the issue.
- [ ] I have written unit tests for the changes or fixes I made.
- [ ] I have checked the documentation and made changes where necessary.
- [ ] I have performed a self-review of my code and refactored it to the best of my abilities.
- [ ] Tickets have been created for newly discovered issues.
- [ ] For any non-trivial functionality, I have added integration and/or end-to-end tests.
- [ ] I have informed others of any required
.envchanges files if required and changed the.env-distaccordingly. - [ ] I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.
Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Todos: I think the --timeout option on some of the commands collides with the default timeout option given for the client context? Also, some timeouts are cast as strings, where others are ints? I cannot find the mentioned default timeouts, maybe they are hidden somewhere else, The report eviction option is not listed in the help file, and maybe we should make it more generic, allowing the eviction of specific types, or even Objects.
Todos: I think the --timeout option on some of the commands collides with the default timeout option given for the client context? Also, some timeouts are cast as strings, where others are ints? I cannot find the mentioned default timeouts, maybe they are hidden somewhere else, The report eviction option is not listed in the help file, and maybe we should make it more generic, allowing the eviction of specific types, or even Objects.
@originalsouth could you check our if these statements need adressing?
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Todos: I think the --timeout option on some of the commands collides with the default timeout option given for the client context? Also, some timeouts are cast as strings, where others are ints? I cannot find the mentioned default timeouts, maybe they are hidden somewhere else, The report eviction option is not listed in the help file, and maybe we should make it more generic, allowing the eviction of specific types, or even Objects.
@originalsouth could you check our if these statements need adressing?
First of all great additions.
I think, the only few thing we still need to introduces is jq (and perhaps jp). Often times the output is piped through jq as we also do in the examples. jq is not a standard tool, so we should introduce it and at least link to it. We can also show maybe an example where jq is used for post processing like:
octopoes/tools/xtdb-cli.py query '{:query {:find [(pull ?var [*])] :where [[?var :type "Origin"]]}}}' | jq -C '.[][] | select(.origin_type != "inference" and (.result | length == 2))'
For instance to list all non-inference origins with two results (something non-trivial in EDN; if possible at all); see also https://github.com/minvws/nl-kat-coordination/pull/3561.
Finally, the options output is as of this writing garbled in the in MD rendering here:
Ive added the generic Eviction for OOI Types, however, dont we also need to delete all Origins for these OOI's? As we are not triggering the octopoes deletion propagation?
Ive added the generic Eviction for OOI Types, however, dont we also need to delete all Origins for these OOI's? As we are not triggering the octopoes deletion propagation?
Personally, I would advice against this; just because of the KIS principle. This can easily be done using Octopoes instructions. xtdb-cli was meant as an interface for basic xtdb/edn instructions/manipulations. Deletion propagation, can be achieved either through http://localhost:8001/docs or using curl on the same place.
Perhaps and octopoes-cli could be an additional tool to achieve this.
Personally, I would advice against this; just because of the KIS principle. This can easily be done using Octopoes instructions.
xtdb-cliwas meant as an interface for basic xtdb/edn instructions/manipulations. Deletion propagation, can be achieved either through http://localhost:8001/docs or using curl on the same place. Perhaps andoctopoes-clicould be an additional tool to achieve this.
To follow up: a beginning of a standalone octopoes client implementation (without cli) can be found here.
Linting should be fixed, and also the garbled layout
Checklist for QA:
- [x] I have checked out this branch, and successfully ran a fresh
make reset. - [x] I confirmed that there are no unintended functional regressions in this branch:
- [x] I have managed to pass the onboarding flow
- [x] Objects and Findings are created properly
- [x] Tasks are created and completed properly
- [x] I confirmed that the PR's advertised
featureorhotfixworks as intended. - [x] I checked the logs for errors and/or warnings and made issues where necessary
What works:
Changes look good and indeed improve the understandability of the xtdb-cli tool. Nice work.
What doesn't work:
n/a
Bug or feature?:
n/a
