Set up the codeminer database and create the required lookup and mapping metadata tables.
Usage
build_database(overwrite = FALSE, format = c("duckdb", "parquet"))Arguments
- overwrite
Logical indicating whether to overwrite existing tables (default:
FALSE).- format
Character. For folder-mode databases, controls how data tables are stored inside the folder. One of:
"duckdb"(default): metadata stays as parquet at the folder root; each data table is a<name>.duckdbfile. Faster recursive queries (CHILDREN etc.) at the cost of ~50% larger disk than"parquet"."parquet": data tables and metadata are all parquet files at the folder root. Smaller on disk; recursive queries hit re-scan cost. Ignored whenCODEMINER_DB_PATHpoints at a single.duckdbfile (there's only one shape — a single DuckDB file).
Examples
# Build a temporary database
db_path <- tempfile(fileext = ".duckdb")
Sys.setenv(CODEMINER_DB_PATH = db_path)
build_database()
#> Creating new database at /tmp/Rtmp2UzWkJ/file1c057170c1ec.duckdb
file.exists(db_path)
#> [1] TRUE