Skip to contents

qryflow_execute() takes a parsed workflow object (as returned by qryflow_parse()), executes each chunk (e.g., @query, @exec), and collects the results and timing metadata.

This function is used internally by qryflow_run(), but can be called directly in concert with qryflow_parse() if you want to manually control parsing and execution.

Usage

qryflow_execute(x, con, ..., source = NULL)

Arguments

x

A parsed qryflow workflow object, typically created by qryflow_parse()

con

A database connection from DBI::dbConnect()

...

Reserved for future use.

source

Optional; a character string indicating the source SQL to include in metadata.

Value

An object of class qryflow_result, containing executed chunks with results and a meta field that includes timing and source information.

Examples

con <- example_db_connect(mtcars)

filepath <- example_sql_path("mtcars.sql")

parsed <- qryflow_parse(filepath)

executed <- qryflow_execute(parsed, con, source = filepath)

DBI::dbDisconnect(con)