Skip to contents

[Experimental] Updates an existing DuckDB database crated by flux_db_build(). When you've downloaded and extracted new data since building the database, this may be faster than rebuilding the database by deleting the .duckdb file and re-running flux_db_build(). If run successfully, it will update the 'manifest' table as well.

Usage

flux_db_update(
  manifest,
  duckdb_path = Sys.getenv("FLUXNET_DB_PATH", unset = "fluxnet/fluxnet.duckdb")
)

Arguments

manifest

A file manifest tibble created by flux_discover_files().

duckdb_path

File path to a .duckdb file used to store FLUXNET data. Can be set with the environment variable FLUXNET_DB_PATH.

Value

Returns nothing; called for side-effects only.

Note

This will error when new CSVs contain columns not already in the database. In this case, you'll have to delete the .duckdb file and run flux_db_build() again to regenerate the database.

Examples

if (FALSE) { # \dontrun{

# Build database
manifest <- flux_discover_files()
flux_db_build(manifest)

# Download and extract additional sites
flux_download()
flux_extract()

# Update database
manifest <- flux_discover_files()
flux_db_update(manifest)

} # }