SQL connector¶
This connector lets you connect data from a SQL server without writing any SQL code.
To connect several tables, you have to create several instances of this connector (one per table).
If you want to create a Join between several tables, you first need to create one datasource by table, and then to
create a datasource of type Join.
In case you need to write custom SQL, you need to create a Raw SQL
connector.
Connection mode¶
There are two connection modes:
From a SQL server
: the connector will use a connection to a server you previously created in theSQL Servers manager
. This is the recommended way as the connection is centralized at a single place.Manually define the credentials for this datasource
: in this mode, you need to manually define all the credentials to access your SQL server in the connector. This mode is harder to maintain.
The field named Datasource variable
is an advanced field (not mandatory). See details below.
button Clear cache
¶
When you connect a SQL table, Serenytics has a cache where it temporarily stores the list of columns and their types. This is an optimization to speed up the queries. But if you change the model of your SQL table (e.g. add a column or change a column's type), this change won't be visible immediately in Serenytics. To ensure your model's evolution is visible in Serenytics, you need to clear the cache using this button.
Datasource variables¶
You can use this field to specify a dict of values to be used in the settings fields (e.g. Host
, Table
...).
Here is an example of value:
{"server_postfix":"PROD", "table_version": 2}
Then you can use these variables in the Database
field, for example:
myserver_{{server_postfix}}
The double curly bracket syntax {{xxx}}
will
be replaced by its value from the datasource variables you defined.
When this datasource is used in a dashboard, these datasource variables are overwritten by variables defined in a dashboard.
If your dashboards are embedded in another app, you can provide these variables in the embedding
payload (i.e. payload passed to the embed
API). Using this mechanism, you can have a single dashboard that is
embedded once and queries several databases (usually one by customer).