Skip to content

Commit bd31e45

Browse files
committed
feat: Create database in a subdirectory of tempdir() by default
1 parent 8bb61a6 commit bd31e45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/relational-duckdb.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ duckplyr_macros <- c(
6565
)
6666

6767
create_default_duckdb_connection <- function() {
68-
dbroot <- Sys.getenv("DUCKPLYR_TEMP_DIR", tempdir())
68+
dbroot <- Sys.getenv("DUCKPLYR_TEMP_DIR", file.path(tempdir(), "duckplyr"))
6969
dbdir <- tempfile("duckplyr", tmpdir = dbroot, fileext = ".duckdb")
70+
dir.create(dbroot, recursive = TRUE, showWarnings = FALSE)
7071

7172
drv <- duckdb::duckdb(dbdir = dbdir)
7273
con <- DBI::dbConnect(drv)

0 commit comments

Comments
 (0)