Skip to content

Commit

Permalink
Merge pull request #89 from stitam/gbif
Browse files Browse the repository at this point in the history
Fix checks on macOS
  • Loading branch information
stitam authored Feb 4, 2025
2 parents e0d74e6 + 36953a9 commit 83488da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Imports:
dbplyr (>= 1.0.0),
magrittr (>= 1.5),
hoardr (>= 0.1.0),
taxize
taxize,
vroom
Suggests:
testthat
Remotes: ropensci/bold, ropensci/taxize
Expand Down
12 changes: 6 additions & 6 deletions R/db_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,15 @@ db_download_gbif <- function(verbose = TRUE, overwrite = FALSE) {
mssg(verbose, 'building SQLite database...')
db <- RSQLite::dbConnect(RSQLite::SQLite(), dbname = db_path)

out <- readr::read_tsv_chunked(
out <- vroom::vroom(
paste0(tdb_cache$cache_path_get(), "/gbif/Taxon.tsv"),
callback = function(chunk, dummy) {
DBI::dbWriteTable(db, "gbif", chunk, append = T)
},
chunk_size = 10000,
col_types = "icccccccccccccccccccccc"
delim = "\t",
col_types = "icccccccccccccccccccccc",
progress = FALSE
)

DBI::dbWriteTable(db, "gbif", out, append = TRUE, batch_rows = 10000)

# create indices
RSQLite::dbExecute(db, 'CREATE UNIQUE INDEX id on gbif (taxonID)')
RSQLite::dbExecute(db, 'CREATE INDEX conname on gbif (canonicalName)')
Expand Down

0 comments on commit 83488da

Please sign in to comment.