Skip to content

Commit

Permalink
Add local arg in init_db
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveViss committed Oct 15, 2024
1 parent 08c43df commit 8a736c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/db_con.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
#' }
#'
#' @export
init_con <- function(){
db <- file.path(db_path(), db_name())
init_con <- function(local = NULL){
if(!is.null(local)){
db <- file.path(local)
} else (
db <- file.path(db_path(), db_name())
)
stopifnot(db |> file.exists())
return(DBI::dbConnect(RSQLite::SQLite(), db))
}

0 comments on commit 8a736c8

Please sign in to comment.