generate_sql_strings: Read all files from path and return a list, where the list...

View source: R/sqlstrings.R

generate_sql_stringsR Documentation

Read all files from path and return a list, where the list elements contain the individual 'SQL' statements and queries as strings

Description

Read all files from path and return a list, where the list elements contain the individual 'SQL' statements and queries as strings

Usage

generate_sql_strings(path = "")

Arguments

path

A path to a folder or a file containing 'SQL' code

Value

A list with named elements containing 'SQL' statements as strings

Examples

## prepare example file
p <- fs::path(tempdir(), "test-file-001.sql")
fs::file_create(p)
readr::write_lines("
  -- name: select_count
  select count(*) from tab1;
", p)

## sqlstrings
s <- generate_sql_strings(path = p)
s$select_count

sqlstrings documentation built on Sept. 9, 2022, 9:06 a.m.