Inspecting the data of the JSON API Query Store
- Leonid_RozenbergOP 2
Should one be able to see the contract data stored in Postgresql after we setup a query store?
In my
daml.yamlI have:json-api-options: - --query-store-jdbc-config=driver=org.postgresql.Driver,url=jdbc:postgresql://localhost:5432/daml_ui_template,user=daml_json_client,password=notaproductionpassword,createSchema=falseRan it with
truethe first time. I can see the data served to me like normal via the React app. But then in psql (asdaml_json_client):daml_ui_template-> \dt List of relations Schema | Name | Type | Owner --------+---------------+-------+------------------ public | contract | table | daml_json_client public | ledger_offset | table | daml_json_client public | template_id | table | daml_json_client (3 rows) daml_ui_template-> SELECT * from contract daml_ui_template-> SELECT * from ledger_offset daml_ui_template-> SELECT * from template_id daml_ui_template->My interest was in measuring the impact of creating an index as @Stephen discussed here.
- cocreature 2
At the moment, only the synchronous POST query endpoint ends up hitting the database. In particular, the following do not go via the database yet:
- Streaming endpoints.
-
fetchand friends. - The GET query endpoint that returns contracts for all templates.
With the exception of 3, there is no fundamental reason for this and we have plans to change this. For 3, I’m a bit hesitant to change it since I don’t think you should use this in a production setup and if you do use it, you could end up throwing a lot of data in your database a lot of which you might not care about.
- Stephen 1
We have Github issues for Postgres caching for (2) fetch et al and (1) streaming endpoints, if you would like to subscribe to them.
- Leonid_Rozenberg 1
Thank you guys this is great. I used
useQueryin the UI (which doesPOST) and the DB was populated.