You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been testing out the connections packages at work. I was able to create a connection in the connections pane with connection_open() and then close the connection with connection_close(). The issue is that there is a reference that remains to the connection in the connections pane, and when you click on it, it has all the connection code including the secrets that you use to make the connection.
Leaving secrets readily available is a little uncomfortable for work stuff, which is why I didn't paste a screen shot. If you reference your README.md you will see what I mean in your connection_close() of your SQLite database.
Solution #1: create a connection_rm(con) that removes the reference to the database after you have closed it.
Solution #2: add a parameter to the connection_close(con, rm_pointer = TRUE) to the current function that completely clears the connection reference from the connections pane.
Solution #3: add a parameter to the connection_open(con, don't_save = TRUE) that mimics the behavior of the work around solution below where none of the code is saved even though the reference to the connection remains.
Work around solution (solution #3 above) Postgres:
First create a connection with RPostgres: pg_con <- RPostgres::dbConnect(...)
Use connection_view(pg_con) to add the connection to the connections pane.
Use connection_close(pg_con) to close the connection. In this case, none of the R code used to make the connection is saved in the reference that remains in the connections pane.
If I was a better tidyverse coder, I would supply a pull request, sorry!
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I have been testing out the connections packages at work. I was able to create a connection in the connections pane with
connection_open()
and then close the connection withconnection_close()
. The issue is that there is a reference that remains to the connection in the connections pane, and when you click on it, it has all the connection code including the secrets that you use to make the connection.Leaving secrets readily available is a little uncomfortable for work stuff, which is why I didn't paste a screen shot. If you reference your README.md you will see what I mean in your
connection_close()
of your SQLite database.Solution #1: create a
connection_rm(con)
that removes the reference to the database after you have closed it.Solution #2: add a parameter to the
connection_close(con, rm_pointer = TRUE)
to the current function that completely clears the connection reference from the connections pane.Solution #3: add a parameter to the
connection_open(con, don't_save = TRUE)
that mimics the behavior of the work around solution below where none of the code is saved even though the reference to the connection remains.Work around solution (solution #3 above) Postgres:
pg_con <- RPostgres::dbConnect(...)
connection_view(pg_con)
to add the connection to the connections pane.connection_close(pg_con)
to close the connection. In this case, none of the R code used to make the connection is saved in the reference that remains in the connections pane.If I was a better tidyverse coder, I would supply a pull request, sorry!
Thanks!
The text was updated successfully, but these errors were encountered: