Content:
Table of Contents |
---|
...
Explore approaches for export inventory instances by using a file with .cql extension with CQL query content.
OPTIONS:
There are two options, how we can use CQL query to export records:
- Use the CQL to fetch all the record`s that match a query from inventory;
- Use the CQL to fetch all the record`s UUIDs, that match a query from inventory;
Use the CQL to fetch all the records that match a query from inventory:
Advantages:
- We don`t need to store a file with UUIDs while using this approach;
- Reduced calls to inventory;
...
We are using the public API of mod-inventory-storage, in my opinion, we should not do any work at our side to sanitize the CQL query. However, if the user will send '*' as a query, the process of getting all instance`s UUIDs for the second option could be very long, it will hit the performance.
In such a case, we can change the instance-bulk/ids endpoint in mod-inventory-storage, and add a query limit and offset, then collect the responses by using them.
...