Skip to content

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

@Fredo-XVII

Description

@Fredo-XVII

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions