yotov_db: The local Yotov database

Description Usage Arguments Examples

View source: R/connections.R

Description

Returns a connection to the local yotov database. This is a DBI-compliant duckdb database connection. When using dplyr-based workflows, one typically accesses tables with yotov_data(), but this function lets the user interact with the database directly via SQL.

Usage

1
yotov_db(dbdir = yotov_path())

Arguments

dbdir

The location of the database on disk. Defaults to yotovdb under rappdirs::user_data_dir(), or the environment variable yotov_DB_DIR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if (yotov_status()) {
  DBI::dbListTables(yotov_db())

  ch1_application1 <- DBI::dbReadTable(yotov_db(), "ch1_application1")

  DBI::dbGetQuery(
    yotov_db(),
    "SELECT * FROM ch1_application1"
  )
}

yotover documentation built on Jan. 28, 2021, 9:06 a.m.

Related to yotov_db in yotover...