connect_db.Rd
Used to connect to the databases using a configuration file - for unix and windows
The credentials are stored in an external file in the home directory ~
.
On Unix: Edit the credentials with file.edit("~/config.yml")
.
On Windows: Edit the credentials with file.edit("~/.my.cnf")
.
connect_db(
credential_name = "db_local",
package = "DBI",
config_path = "~/config.yml",
default.file.windows = "~/.my.cnf"
)
Credential identification in the configuration file,
example datascience
, factfield_data
or pubmed
The package to be used: DBI or dbx
Path to the credential file,
example: "~/dbconfig.yml"
Path to the configuration file in windows
example: "~/.my.cnf"
What inside .yml file?
What inside .cnf file?
Something like that: https://gist.github.com/rhtyd/d59078be4dc88123104e
connect_db() # this connect to factfield_data db_main auto using the credential from the yml data.
#> <MariaDBConnection>
#> Host: localhost
#> Server:
#> Client: