Is there any way to hide snippet file from Connection Pane in RStudio?

As a database administrator, I am making database connectivity using snippet files in R. (Refer RStudio Connections ). Following is the example snippet file which I put in /etc/rstudio/connections/ directory on my AWS linux instance.

driver <- dbDriver("MariaDB")
# 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?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.