Learn R Programming

qryflow (version 0.2.0)

qryflow_run: Parse and execute a tagged SQL workflow

Description

qryflow_run() reads a SQL workflow from a file path or character string, parses it into tagged statements, and executes those statements against a database connection.

This function is typically used internally by qryflow(), but can also be called directly for more control over workflow execution.

Usage

qryflow_run(con, sql, ...)

Value

A list representing the evaluated workflow, containing query results, execution metadata, or both, depending on the contents of the SQL script.

Arguments

con

A database connection from DBI::dbConnect()

sql

A character string representing either the path to a .sql file or raw SQL content.

...

Additional arguments passed to qryflow_execute().

See Also

qryflow(), qryflow_results(), qryflow_execute(), qryflow_parse()

Examples

Run this code
con <- example_db_connect(mtcars)

filepath <- example_sql_path("mtcars.sql")

obj <- qryflow_run(con, filepath)

obj$df_mtcars$sql
obj$df_mtcars$results

results <- qryflow_results(obj)

head(results$df_mtcars$results)

DBI::dbDisconnect(con)

Run the code above in your browser using DataLab