Dynamic Data Set
Now that we have successfully connected the Vizzly Query Engine to your database, it is time to send it our first dynamic Vizzly Config.
Building our first dynamic config
The config defines one or more data sets that you will make available on the dashboard. You can either define it using a SQL statement, or by referencing tables and fields along with instructions on how the tables are joined together.
Each integration has its own config definition, find the one that applies to you, and start building! For this example, we advise you manually craft a config to see how dynamic configs would work, before writing the code to dynamically generate the configs.
If you wish to find examples of configs, you can do so in our GitHub examples repo (opens in a new tab)!
Test the dynamic config
To try out your new config, we can use the vizzly list-data-sets
CLI command.
First, save your dynamic config into a file named dynamic-vizzly-config.json
in the same directory as your vizzly-private.pem
certificate.
Next, we will run the CLI command. This example assumes you have the query engine running locally at http://0.0.0.0:8000
. If your query engine URL is different, then please replace the one
in this example with your own!
vizzly list-data-sets \
--queryEngineEndpoint http://0.0.0.0:8000 \
--dynamic-config ./dynamic-vizzly-config.json
If the request is successful, you will see the ID of your dynamic data set returned back to you!
Getting production ready
Now you've verified that the Vizzly Query Engine can accept your dynamic config, we need to know how to achieve this in production.
To make this work in production, you will need to set the queryEngineEndpoint
property of the React dashboard to an endpoint on your own servers.
This endpoint will then need to proxy the requests on to the Vizzly Query Engine, whilst being sure to attach the auth
and config
headers.