Skip to contents

qryflow_parse() reads a SQL file or character vector and parses it into discrete chunks based on @query, @exec, and other custom markers.

Usage

qryflow_parse(
  sql,
  ...,
  default_type = getOption("qryflow.default.type", "query")
)

Arguments

sql

A file path to a SQL workflow file, or a character vector containing SQL lines.

...

Reserved for future use.

default_type

The default chunk type (defaults to "query"). The global default can be set with options(qryflow.verbose = TRUE).

Value

An object of class qryflow_workflow, which is a structured list of SQL chunks and metadata.

Details

This function is used internally by qryflow_run(), but can also be used directly to preprocess or inspect the structure of a SQL workflow.

Examples

filepath <- example_sql_path("mtcars.sql")

parsed <- qryflow_parse(filepath)