JSON API Query Store documentation out of date, help needed

The documentation says:

Note

When you use the Query Store you’ll want your first run to specify createSchema=true so that all the necessary tables are created. After the first run make sure createSchema=false so that it doesn’t attempt to create the tables again.

See: HTTP JSON API Service — Daml SDK 1.16.0 documentation

It turns out that the createSchema=true/false option is deprecated, from the help text:

[main] WARN com.daml.http.JdbcConfig$ - The option 'createSchema' is deprecated. Please use 'start-mode=create-only' for 'createSchema=true' and 'start-mode=start-only' for 'createSchema=false'

Do I need to do the same with these options as is written in the docs for the previous version? Meaning:

At first run, use the ‘start-mode=create-only’ option.
Afterwards use the ‘start-mode=start-only’.

Or do something else?

Yes the same applies to the new options. They are equivalent to the existing ones. Alternatively you can use start-mode=create-if-needed-and-start which will create the schema if it doesn’t exist or is in compatible (e.g. after an sdk upgrade) and start in one go.

2 Likes

This last one aeems to be the most convenient, thanks

For my current implementation it appears the start-mode=create-if-needed-and-start did not create the schema. I am on JDK 1.13.1
I still had to start the JSONAPI with createSchema=true first before starting it up with start-mode=create-if-needed-and-start

Only afterwards my websocket failures disappeared in the UX

Very weird, I thought my test coverage was working correctly but from what you tell it looks like something went wrong. Thanks for the report, I will take a look and see if I can fix it fast.

(By the one who implemented that feature :joy_cat:)

One question though, what SDK version are you using and do you use a specific database backend?

I’m still waiting for more input on this topic, because our tests do cover what you report doesn’t work. Could you open an issue here on github with reproduction steps, sdk version, os etc.?