Admin Variables
Table of contents
Variables
Disclaimer: this article does NOT cover variables used in SQL editor.
What are variables
A variable is a special template which is replaced with an associated value. Variables help keep your configuration clean and tidy by avoiding unnecessary repetitions: instead of manually replacing each occurrence of some value, you can replace the value of a variable just once and its occurrences will be kept intact.
Variables are available in a lot of places. You might find them in:
- The Connection settings
- The SSH tunnel settings
- Data Transfer and in other tasks
- The Command Line Interface
Wherever you find variables available in the user interface, a hint will usually be present:
By clicking on it, a separate window will open showing all the available variables with their descriptions and values:
Using variables
To use the variables you need to utilize a special syntax:
${variable_name}
Where variable_name
is a variable name which you want to use. The window shown above already contains ${
и }
anchors so you do not need to specify them multiple times.
Variables may be a part of something bigger: e.g., a part of a path. For example, if some file lies under the user's root folder, you may want to use variable home
: ${home}
: ${home}/path/to/file.txt
.
The Variable resolution
A value of a particular variable may be resolved from different places depending on its origin.
The resolution is performed in the following order (from the highest to the lowest priority):
- Dialog, where a specific variable is used
- Datasource-specific variables (
host
,port
,server
,database
, etc.) - Application-specific variables (
application.name
,application.version
,home
, etc.) - Environment variables. For additional information see Wikipedia.
If you have an environment variable called
home
, it will be resolved in the application-specific variable because it has higher priority.