As a database administrator, I am making database connectivity using snippet files in R. (Refer https://rstudio.github.io/rstudio-extensions/rstudio-connections.html ). Following is the example snippet file which I put in
/etc/rstudio/connections/ directory on my AWS linux instance.
driver <- dbDriver("MariaDB") print("connecting.......") # define connection connection <- DBI::dbConnect(driver, host = Sys.getenv("MySQLHost"), username = Sys.getenv("MySQLUSER"), password = Sys.getenv("MYSQLPASSWORD"), port = Sys.getenv("MySQLPort")) print("Sucessfully connected to MySQL Database!")
Now when I try to add new connection in RStudio, the connection pane shows the complete snippet file to the user. It leads to some security issues(as it includes db configurations and password). Please refer screenshot below:
Is there any way to hide the database connection file from the end user?