Status: contract version 1.
The desktop application, the Excel add-in and the provider executables read
one settings file, settings.json, to know which data store to open, where
to find plug-ins and which providers to use. Its JSON Schema is
settings.schema.json, shipped in the sdk
folder of the desktop application.
Where it is read
Each section (store, providers, plugins) is taken whole from the first
of these that has it:
- a section of the machine file marked
"locked": true; - the file given on the command line with
--settings PATH; - the user's file,
%APPDATA%\ThirdMoment\QuantX\settings.json; - the machine file,
%ProgramData%\ThirdMoment\QuantX\settings.json, which the client's IT team deploys; - the built-in default: the SQLite file
%LOCALAPPDATA%\ThirdMoment\QuantX\Data\quantx.db, no plug-in.
Only the machine file can lock a section. A lock is a deployment convenience, not security: a user who can write the machine file or the program can defeat it.
Content
{
// Comments and trailing commas are accepted.
"contractVersion": 1,
"store": {
"type": "Acme warehouse",
"options": { "Server": "db01", "Password": "acme-password" },
"locked": true
},
"providers": {
"folders": ["C:\\Program Files\\Acme\\QuantXProviders"],
"defaultSeries": "FRED"
},
"plugins": { "folders": ["C:\\Program Files\\Acme\\QuantXStores"] }
}
| Member | Meaning |
|---|---|
contractVersion |
optional; when given, must be 1 |
store.type |
the store's name: SQLite, Scratch (in memory) or a plug-in's name |
store.options |
the store's options, all texts; a secret option holds the name of a secret saved for the user, never the secret |
providers.folders |
folders holding provider executables, each with its manifest (Provider protocol) |
providers.defaultSeries |
the provider of data series when none is named |
plugins.folders |
the only folders where data store plug-ins are looked for; providers are looked for here too |
*.locked |
machine file only: the section cannot be overridden |
Unknown members are refused, and a file that is not valid is refused with its name and the reason. Store names are matched without regard to case.
The bundled stores
| Store | Options |
|---|---|
SQLite |
Path: the database file, as a full path; by default the file above |
Scratch (in memory) |
none: an empty store, lost when the program closes; provider executables cannot fill it |
Editing it
Users edit their own file on the desktop's Settings > Data page or in the Excel add-in's Data settings dialog (ribbon tab QuantX). Both write only the sections the user changed, keep the others as the file has them, and never write a section the machine file locks. A secret option is saved encrypted for the user (Windows DPAPI), and only its name goes in the file. The file is written beside itself and then moved over the old one, so a program starting meanwhile never reads half a file.
If a settings file cannot be read, the desktop application says which file and why, and that the machine file is the IT team's to correct. If the store cannot be opened and the machine file does not lock it, the desktop offers to start on the default SQLite store so that the user can change the settings.
When it changes
A change of store applies when the program next starts. The desktop application passes the settings it opened with to the provider executables it runs, so that they use the same store even if the files change meanwhile.