Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Functon Request: connection_rm() or connection_close(con, rm_pointer = TRUE) #7

Open
Fredo-XVII opened this issue Aug 18, 2020 · 0 comments

Comments

@Fredo-XVII
Copy link

Fredo-XVII commented Aug 18, 2020

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 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:

  1. First create a connection with RPostgres: pg_con <- RPostgres::dbConnect(...)
  2. Use connection_view(pg_con) to add the connection to the connections pane.
  3. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant