generate_sql_strings {sqlstrings}R 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

[Package sqlstrings version 1.0.0 Index]