ropensci / taxadb

:package: Taxonomic Database
https://docs.ropensci.org/taxadb
Other
43 stars 13 forks source link

duckdb version #97

Closed andrew-torda closed 2 years ago

andrew-torda commented 2 years ago

Is there a problem with duckdb versions ? If I say,

library(taxadb)
a <- taxadb::get_ids (names=c("homo sapiens"))

I get

Error in initialize(value, ...) : 
  duckdb_startup_R: Failed to open database: IO Error: Trying to read a database file with version number 21, but we can only read version 25.
The database file was created with an older version of DuckDB.

Of course, one can Sys.setenv(TAXADB_DRIVER="RSQLite") to avoid the issue.

cboettig commented 2 years ago

apologies, you have upgraded duckdb and it's trying to say that your newer version of duckdb isn't compatible with the database built by the older version. Purging the old db, e.g.

fs::dir_delete(taxadb:::taxadb_dir())

and letting it rebuild should fix that. Maybe we can better automate that in the next release. Once duckdb is more stable, it will become backwards compatible between releases as well and this won't be an issue.

andrew-torda commented 2 years ago

That does fix it. I should have seen this. I do not think anyone can expect you to automate this kind of thing. The only suggestion I would have is a note in the documentation... "If duckdb complains about an old database format, delete the old database fs::dir_delete(taxadb:::taxadb_dir()) and let it rebuild itself."

Many thanks