Learn R Programming

qryflow (version 0.2.0)

read_sql_lines: Standardizes lines read from string, character vector, or file

Description

This is a generic function to ensure lines read from a file, a single character vector, or already parsed lines return the same format. This helps avoid re-reading entire texts by enabling already read lines to pass easily.

This is useful for folks who may want to extend qryflow.

Usage

read_sql_lines(x)

Value

A qryflow_sql object (inherits from character) with a length equal to the number of lines read

Arguments

x

a filepath or character vector containing SQL

Examples

Run this code
# From a file #####
path <- example_sql_path()
read_sql_lines(path)

# From a single string #####
sql <- "SELECT *
FROM mtcars;"
read_sql_lines(sql)

# From a character #####
lines <- c("SELECT *", "FROM mtcars;")
read_sql_lines(lines)

Run the code above in your browser using DataLab