tar_sql_deps: List SQL query dependencies.

View source: R/tar_sql_deps.R

tar_sql_depsR Documentation

List SQL query dependencies.

Description

List the target dependencies of one or more SQL queries.

Usage

tar_sql_deps(path)

Arguments

path

Character vector, path to one or more SQL queries.

Value

Character vector of the names of targets that are dependencies of the SQL query.

Examples

lines <- c(
  "-- !preview conn=DBI::dbConnect(RSQLite::SQLite())",
  "-- targets::tar_load(data1)",
  "-- targets::tar_read(data2)",
  "select 1 as my_col",
  ""
)
query <- tempfile()
writeLines(lines, query)
tar_sql_deps(query)

sqltargets documentation built on June 22, 2024, 10:54 a.m.