LoadCausataConfig(group)
.causata-config.yaml
, and it must be located in the user's home directory. This function
will attempt to load the file using path.expand
:path.expand("~/.causata-config.yaml")
Two functions in the Causata package will call LoadCausataConfig
if a group name is provided:
CausataConfig
, and Connect
.
The parameter names provided in the config file will be mapped to the input parameters of these functions.
The format of the configuration file is simple. There are one or more groups with a set of indented parameters below. The group and parameter names are followed by a colon.
If the user has a configuration file as shown in the example below, then calling this function returns a list as follows:
Example .causata-config.yaml file
# Use hash for comments example.1: sql.server.host : 123.456.789.219 sql.server.port : 33060 config.server.host : 123.456.789.100 config.server.port : 8003 username : example@causata.com password : ni83jfH
example.2: sql.server.host : 123.456.789.999 sql.server.port : 33060 config.server.host : 123.456.789.500 config.server.port : 8003 username : example@causata.com password : 972hfgHB
If "example.1" is used then the first set of parameters is returned in a list:
LoadCausataConfig("example.1") $sql.server.host [1] "123.456.789.219" $sql.server.port [1] 33060 $config.server.host [1] "123.456.789.100" $config.server.port [1] 8003 $username [1] "example@causata.com" $password [1] "ni83jfH"
Similarly, if the "example.2" group is supplied then the second set of parameters is returned in a list:
LoadCausataConfig("example.2") $sql.server.host [1] "123.456.789.999" $sql.server.port [1] 33060 $config.server.host [1] "123.456.789.500" $config.server.port [1] 8003 $username [1] "example@causata.com" $password [1] "972hfgHB"
path.expand
,
yaml.load_file
,
CausataConfig
,
Connect
.