Skip to contents

Creates a SQLite database if needed, creates the tracking schema, and returns an open DBI connection. Existing data are preserved unless overwrite = TRUE.

Usage

init_tracking_db(path, overwrite = FALSE)

Arguments

path

Path to the SQLite database file.

overwrite

If TRUE, remove an existing database file before creating a new one. If FALSE, keep the existing file and create missing tables.

Value

A DBI connection.

Examples

db_path <- tempfile(fileext = ".sqlite")
con <- init_tracking_db(db_path, overwrite = TRUE)
DBI::dbDisconnect(con)