Skip to content

Commit

Permalink
don't overwrite existing (valid) connection objects
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Jun 18, 2023
1 parent 9ab3c62 commit efd0221
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/gpkg-connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ gpkg_connect <- function(x)
#' @export
#' @rdname gpkg-connection
gpkg_connect.geopackage <- function(x) {
obj <- as.character(substitute(x))
x$env$con <- gpkg_connect(x$dsn)$env$con
econ <- x$env$con
if (is.null(econ) || !DBI::dbIsValid(econ))
x$env$con <- gpkg_connect(x$dsn)$env$con
x
}

Expand Down

0 comments on commit efd0221

Please sign in to comment.