Learn R Programming

acdcquery (version 1.2.3)

update_database: Update a local SQLite database from a GitHub release

Description

Internal helper function that compares a local SQLite database with a GitHub release and optionally downloads the latest version.

Usage

update_database(
  owner,
  repo,
  asset_name,
  local_sqlite_path,
  tag = NULL,
  token = Sys.getenv("GITHUB_PAT"),
  algo = "sha256",
  update = FALSE
)

Value

Invisibly returns TRUE if the local database is up to date, FALSE if it is outdated (and possibly updated if update = TRUE).

Arguments

owner

GitHub repository owner.

repo

GitHub repository name.

asset_name

Name of the SQLite file in the release.

local_sqlite_path

Path to the local SQLite database.

tag

Optional release tag. If NULL, uses latest release.

token

Optional GitHub token. Defaults to Sys.getenv("GITHUB_PAT").

algo

Hash algorithm to use (default: "sha256").

update

Logical; if TRUE, will download the latest database when the local copy is outdated (default: FALSE).